python3使用requests模块的get方法作爬虫(假装浏览器)

获取网页对象可使用两种方法:html 使用urllib模块的urlopen方法:web import urllib reponse=urllib.urlopen("http://www.itcast.cn") print(reponse.read()) reponse.read():打开网页源代码。 reponse.getcode():获取http状态码:200表示请求完成,404表示网址找不到
相关文章
相关标签/搜索