# First, add req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'}) # then type html = urllib.request.urlopen(req).read()