#Author:Mini
#!/usr/bin/env python
import urllib.request
url1="http://blog.sina.com.cn/s/blog_470071c90102x8jc.html"
headers=("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36Query String Parametersview sourceview URL encoded")
opener=urllib.request.build_opener()
opener.add_handler=[headers]
data=opener.open(url1).read()
fh=open("E:/4.html","wb")
fh.write(data)
fh.close()
转载于:https://www.cnblogs.com/rabbittail/p/7620410.html