python-email-crawler
python-email-crawler copied to clipboard
SyntaxError: multiple exception types must be parenthesized
I am getting this error right after I execute the script, here's the try except that generates the error: try: logger.info("Crawling %s" % url) request = urllib2.urlopen(req) except urllib2.URLError, e: logger.error("Exception at url: %s\n%s" % (url, e)) any idea what might be wrong? Thanks.
I'm getting the same error too
I'm getting the same error too
In Python 3.x, urllib2 has been split into urllib.request and urllib.error. You should replace urllib2 with urllib.request and handle the exceptions using urllib.error