# module code
import sys
if sys.version_info.major < 3:
+ stringbase = basestring
import urllib2
import urlparse
import HTMLParser
html = HTMLParser.HTMLParser()
from BeautifulSoup import BeautifulSoup
else:
+ stringbase = str
import urllib.request as urllib2
import urllib.parse as urlparse
import html
num_found += 1
if num_found > limit:
return responses
- resp = action(match)
+ if isinstance(match, stringbase):
+ resp = action(match)
+ else:
+ resp = action(*match)
if resp is not None:
responses.append("%s: %s" % (prefix, action(match)))
return responses