![]() |
1
hebwjb 2016-07-09 13:45:17 +08:00 ![]() header = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36"}
requests.get('http://zhihu.com',headers=header) <Response [200]> |
![]() |
2
coolloves 2016-07-09 13:48:19 +08:00
加个 headers 就可以了把
|
![]() |
5
GreatMartial 2016-07-09 16:00:19 +08:00
@nlimpid 有的网站要检查你的请求环境,你不模拟,就认定你是机器
|
![]() |
6
CosimoZi 2016-07-09 18:13:33 +08:00
知乎现在防爬虫越来越严格了……之前我爬还不需要 headers 就能上。
|
![]() |
7
tobacco 2016-07-09 20:39:52 +08:00
有现成的知乎爬虫: https://github.com/egrcc/zhihu-python
|