Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2022 18:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
403 example
import urllib.request
with urllib.request.urlopen('') as conn:
feed ='utf-8')
(~) % python                                                                                                                                              Wed 2 12:38PM  lake 
Traceback (most recent call last):
  File "/home/hecanjog/", line 3, in <module>
    with urllib.request.urlopen('') as conn:
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 214, in urlopen
    return, data, timeout)
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 523, in open
    response = meth(req, response)
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 632, in http_response
    response = self.parent.error(
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 561, in error
    return self._call_chain(*args)
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 494, in _call_chain
    result = func(*args)
  File "/home/hecanjog/.pyenv/versions/3.9.9/lib/python3.9/urllib/", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
zsh: exit 1     python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment