From c8eb3028cc509eb603e8b113c66f7c4eeee828b9 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Thu, 15 Mar 2012 11:08:02 -0400 Subject: Fixed a bug where specifying 'text' while searching for a tag only worked if 'text' specified an exact string match. [bug=955942] --- bs4/element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bs4/element.py') diff --git a/bs4/element.py b/bs4/element.py index d2fa19f..4ff9cd4 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -1156,7 +1156,7 @@ class SoupStrainer(object): found = markup else: found = markup_name - if found and self.text and self.text != found.string: + if found and self.text and not self._matches(found.string, self.text): found = None return found searchTag = search_tag @@ -1188,7 +1188,7 @@ class SoupStrainer(object): return found def _matches(self, markup, match_against): - # print "Matching %s against %s" % (markup, match_against) + #print "Matching %s against %s" % (markup, match_against) result = False if isinstance(markup, list) or isinstance(markup, tuple): -- cgit v1.2.3