python爬虫请求头设置代码

上传:qq_32494336 浏览: 32 推荐: 0 文件:PDF 大小:50.05KB 上传时间:2020-12-23 06:52:23 版权申诉
一、requests设置请求头: import requests url="http://www.targetweb.com" headers={ 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Cache-Control':'max-age=0', 'Connection':'keep-alive', 'Referer':'http://www.baidu.com/', 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW6
上传资源
用户评论