diff options
Diffstat (limited to 'bs4/__init__.py')
-rw-r--r-- | bs4/__init__.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bs4/__init__.py b/bs4/__init__.py index 6406bef..c036521 100644 --- a/bs4/__init__.py +++ b/bs4/__init__.py @@ -63,7 +63,7 @@ class BeautifulSoup(Tag): # can be replaced with a single space. A text node that contains # fancy Unicode spaces (usually non-breaking) should be left # alone. - STRIP_ASCII_SPACES = { 9: None, 10: None, 12: None, 13: None, 32: None, } + STRIP_ASCII_SPACES = {9: None, 10: None, 12: None, 13: None, 32: None, } def __init__(self, markup="", features=None, builder=None, parse_only=None, from_encoding=None): @@ -165,7 +165,6 @@ class BeautifulSoup(Tag): self.previous_element = o self.currentTag.contents.append(o) - def _popToTag(self, name, inclusivePop=True): """Pops the tag stack up to and including the most recent instance of the given tag. If inclusivePop is false, pops the tag @@ -177,9 +176,10 @@ class BeautifulSoup(Tag): numPops = 0 mostRecentTag = None - for i in range(len(self.tagStack)-1, 0, -1): + + for i in range(len(self.tagStack) - 1, 0, -1): if name == self.tagStack[i].name: - numPops = len(self.tagStack)-i + numPops = len(self.tagStack) - i break if not inclusivePop: numPops = numPops - 1 @@ -202,7 +202,7 @@ class BeautifulSoup(Tag): if (self.parse_only and len(self.tagStack) <= 1 and (self.parse_only.text - or not self.parse_only.searchTag(name, attrs))): + or not self.parse_only.search_tag(name, attrs))): return None tag = Tag(self, self.builder, name, attrs, self.currentTag, @@ -215,7 +215,6 @@ class BeautifulSoup(Tag): self.pushTag(tag) return tag - def handle_endtag(self, name): #print "End tag: " + name self.endData() |