Oct-25-2020, 03:46 PM
Hello Python experts,
when trying to execute this little code snippet
request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 406: Not Acceptable
What could e the problem? I have checked and the url link is valid.
when trying to execute this little code snippet
import urllib.request scarlet_pimpernel_link = r'https://gutenberg.org/cache/epub/60/pg60.txt' count = 0 with urllib.request.urlopen(scarlet_pimpernel_link) as ip_file: for line in ip_file: count += 1 print(count)there is an exception message, something like:
request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 406: Not Acceptable
What could e the problem? I have checked and the url link is valid.