1. 首页
  2. 数据库
  3. 其它
  4. python爬虫请求头设置代码

python爬虫请求头设置代码

上传者: 2020-12-23 06:52:23上传 PDF文件 50.05KB 热度 35次
一、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
下载地址
用户评论