Python3-伪装浏览器

url = "https://www.douban.com/"  
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '  
                        'Chrome/51.0.2704.63 Safari/537.36'}  
req = urllib.request.Request(url=url,headers=headers)  
  
res = urllib.request.urlopen(req)  
  
data = res.read()

你可能感兴趣的:(Python3-伪装浏览器)