www.cnvd.org.cn是个很奇怪的网站,如过你用浏览器访问时正常的,但是如果用http请求就会出现各种错。比如:
wget http://www.cnvd.org.cn 返回:
--2016-08-26 20:37:00-- http://www.cnvd.org.cn/
Resolving www.cnvd.org.cn (www.cnvd.org.cn)... 113.200.91.208, 42.48.109.207
Connecting to www.cnvd.org.cn (www.cnvd.org.cn)|113.200.91.208|:80... connected.
HTTP request sent, awaiting response... 521
2016-08-26 20:37:00 ERROR 521: (no description).
如果用curl执行则会返回一段JS代码
js也研究了下。是动态设置cookie的。
一个月前整站已经被扒下来了,最近发现没有增加数据量才知道爬虫被ban了,前段时间调试的时候将浏览器的请求头全部复制到爬虫中科院正常运行,但是这两天此方法已经失效。。。
请大家给我个思路,感觉瞬间没爱了!
Your crawler must have been detected by the website. If the headers are not working, then you can only check whether it is restricted by your IP or account. If you do not need to log in, you can try changing the IP first to see if it is normal, or directly in the crawler. Manually access the server to see if it is successful
------Update-------
At the request of the questioner, I posted the test code. The cookie here was obtained by manual access just now. It will be no problem to bring it in for access. As for the expiration time of the cookie, I did not read it carefully. If the questioner does not understand, I'll take a better look.
Hope it helps you
Friend, I have been browsing this website recently, and I would like to give you some opinions. You can take a look. If you are willing to communicate, please add me as a friend.
cnvd can be climbed under normal circumstances.
www.cnvd.org.cn This thing is quite disgusting, many heads turned to 521.