python 爬虫 浏览器伪装
import urllib.request
url="http://blog.csdn.net"
header=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36')
opn=urllib.request.build_opener()
opn.addheaders=[header]
data=opn.open(url).read()
print(data.decode())