python-email-crawler icon indicating copy to clipboard operation
python-email-crawler copied to clipboard

SyntaxError: multiple exception types must be parenthesized

Open hamzaaitbrik opened this issue 2 years ago • 2 comments

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.

hamzaaitbrik avatar Jul 18 '22 04:07 hamzaaitbrik

image I'm getting the same error too

FaisalAhmed123 avatar Jul 23 '23 11:07 FaisalAhmed123

image 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

TT5H avatar Mar 08 '24 15:03 TT5H