summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-03-15 11:08:02 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2012-03-15 11:08:02 -0400
commitc8eb3028cc509eb603e8b113c66f7c4eeee828b9 (patch)
tree91a76b2921d9ed4a1f37dfc9ac6765d65cb82759 /bs4/element.py
parent4b0975ed159bd789db6896da159f654229310701 (diff)
Fixed a bug where specifying 'text' while searching for a tag only worked if 'text' specified an exact string match. [bug=955942]
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py4
1 files changed, 2 insertions, 2 deletions
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):