爬取起点免费书籍目录request.get访问返回值为Response [202]
初学python
用到requests访问 起点免费书籍网页,得到返回值为Response [202](只有第一次访问成功Response [200],继续运行程序返回值为Response [200])
搜索了一下问题,Response [202]表示网站已接受到访问请求,但是要排队处理。有的人说是起点现在用的是动态cookie,
代码如下
import requests
import re
title = 'https://book.qidian.com/info/1033679334/'
y = {
'referer': 'https: //www.qidian.com/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 '
'Safari/537.36 '
'Edg/105.0.1343.42 ',
}
title_list = requests.get(url=title, headers=y).text
print(requests.get(url=title, headers=y))
print(title_list)
打印出来的网页信息也不对(headers里加上cookie,结果也一样)。
请问是什么原因呢。