爬取百度首页
import urllib.request # 调用urllib库的request模块
respone=urllib.request.urlopen('http://www.baidu.com') # 打开百度页面
html=respone.read().decode('UTF-8') # 获取页面内容
print(html)
爬取百度首页
import urllib.request # 调用urllib库的request模块
respone=urllib.request.urlopen('http://www.baidu.com') # 打开百度页面
html=respone.read().decode('UTF-8') # 获取页面内容
print(html)