Blog of Sara Jakša

Raising the Error by also Printing it

In the previous post, I talked about that I had one problem with errors. Well, even though it did not help me later, I still researched how to see the errors, without them stopping the script.

    try:
        page = urllib.request.urlopen(webpage)
    except Exception as e:
        #e is the error
        print(e) 

Just in case somebody else finds it helpful.