python实战:经过假装浏览器爬取信息

一、对于网站url为http协议的,咱们能够直接经过urlopen()直接爬取 例如: import urllib.request #爬百度首页 url='http://www.baidu.com/' #读取响应信息并解码 html=urllib.request.urlopen(url).read().decode('utf-8') #打印爬到的信息 print(html) 爬取结果为 二、但
相关文章
相关标签/搜索