python 3.6 - Except statement gives syntax error -


the code same in book web scraping python according code tested on python version 3.4+. python ide using python 3.6.x, still shows syntax error.

the error is

 except(urlerror, httperror, contenttooshorterror) e: ^ syntaxerror: invalid syntax 

here's code:

    import urllib.request     urllib.error import urlerror, httperror, contenttooshorterror     def download(url):     print('downloading:', url)     try:         html = urllib.request.urlopen(url).read()         except(urlerror, httperror, contenttooshorterror) e:         print('download error:', e.reason)         html = none         return html         download('https://en.wikipedia.org/wiki/main_page') 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -