urllib.error.HTTPError: HTTP Error 404: Not Found

by darkblue80   Last Updated October 09, 2019 15:02 PM - source

The code's below. And I get "urllib.error.HTTPError: HTTP Error 404: Not Found".

import urllib.request import urllib.parse headers = {} headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686)" values = {'q': 'python programming tutorials'} data = urllib.parse.urlencode(values) url = 'https://www.google.com/search'+data req = urllib.request.Request(url, headers = headers) resp = urllib.request.urlopen(req) resp_data = resp.read() print(resp_data)

Tags : python3


Related Questions


How to install PyQt for python3 in ubunt 14.10?

Updated April 22, 2015 08:00 AM

Levenshtein in python

Updated April 22, 2015 21:00 PM

vim with python3 compatibility

Updated May 13, 2015 16:00 PM


access windows shared folder using python

Updated September 19, 2015 14:01 PM