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

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