Skip to content Skip to sidebar Skip to footer

Urllib Exception Http.client.badstatusline

I can't for the life of me figure out why I can't catch this exception. Looking here at this guide. def get_team_names(get_team_id_url, team_id): print(get_team_id_url + team_

Solution 1:

This http.client.BadStatusLine is a subclass of http.client.HTTPException. I think if you do:

try:
    response = urllib.request.urlopen(get_team_id_url + team_id)
except http.client.HTTPException as e:
    print(e)

then you shouldn't have problem catching it. However, what caused it is perhaps what you should concern.

Post a Comment for "Urllib Exception Http.client.badstatusline"