Some websites are blocked from normal browser and it works well in incognito mode
我正试图用python从一个网站上抓取一些数据。在最初的阶段,它工作得很好,但最近它开始阻止来自我的系统的脚本请求和浏览器。我知道对于目标站点会有一些阻塞机制,但是我可以从匿名模式浏览相同的站点,而不会有任何问题。
我怎么修这个?我尝试了在匿名浏览器中使用一些头值,但没有结果。
感谢您的帮助。
添加已尝试的引用头值
"Accept":"/","Accept-Encoding":"gzip, deflate, br",
"Accept-Language":"en-US,en;q=0.8","Cache-Control":"no-cache",
"Connection":"keep-alive","Content-Length":"8",
"Content-Type":"application/x-www-form-urlencoded",
"Cookie":"JSESSIONID=6+b5vN7wfvBUHfQOK0d7bls;
TS01747e58=01d69c8eb5156bae15c47b3d2578bc88361c69fb48d9ec815b7e3e48aaab4afb974a4d8f5b448e558bfcd1da01f6246b460e8d88a2f87a126f095a23ccdd3d50439c61ecc9;
BIGipServerjboss=759271946.20480.0000;
TS011968e6_28=01fabe97068921f1b57e70731e79cb34f9d73bcf98d7d1f65c7eb46ba87d3e6e751dec2ee2109c7bc65b7e3cdb05d397b47bdaf21e;
TS011968e6=01d69c8eb5a3b1ea223ea72b0b4ace9a0ac39268b9d9ec815b7e3e48aaab4afb974a4d8f5b4d619ddc6882f5ecbd3007321d57f557b77bb39ff7ab95e2310bfa4be41364ef",
"Host":"abc.co.in","Origin":"https://abc.co.in","Pragma":"no-cache",
"Referer":"https://abc.jsp","User-Agent":"Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116
Safari/537.36","X-Requested-With":"XMLHttpRequest",
"X-TS-AJAX-Request":"true",
如果它在
如果你想爬行的东西没问题,可以在你的
1 | COOKIES_ENABLED = False |