From 49f03f8c6617003f59fb328e5f8c1fd784fa66b4 Mon Sep 17 00:00:00 2001 From: Ruairi Fahy Date: Tue, 21 Jun 2016 18:23:25 +0100 Subject: [PATCH] Handle uppercase script tags --- scrapely/_htmlpage.pyx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scrapely/_htmlpage.pyx b/scrapely/_htmlpage.pyx index a050500..c138f6a 100644 --- a/scrapely/_htmlpage.pyx +++ b/scrapely/_htmlpage.pyx @@ -139,15 +139,14 @@ cdef class ScriptParser: cdef int parse(self, Py_UCS4 c, int i): if self.state == 10: self.state = 1 - if ((self.state == 1 and c == u'<') or (self.state == 2 and c == u'/') or - (self.state == 3 and c == u's') or - (self.state == 4 and c == u'c') or - (self.state == 5 and c == u'r') or - (self.state == 6 and c == u'i') or - (self.state == 7 and c == u'p') or - (self.state == 8 and c == u't') or + (self.state == 3 and c == u's' or c == u'S') or + (self.state == 4 and c == u'c' or c == u'C') or + (self.state == 5 and c == u'r' or c == u'R') or + (self.state == 6 and c == u'i' or c == u'I') or + (self.state == 7 and c == u'p' or c == u'P') or + (self.state == 8 and c == u't' or c == u'T') or (self.state == 9 and c == u'>')): self.state += 1 else: