windows - Python爬虫爬资源时由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。怎么破?
迷茫
迷茫 2017-04-18 10:14:55
0
2
4417
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
小葫芦

You can use the scrapy framework to implement the crawler. You can try 3 times if the crawl fails. If it still fails, you can customize it and write it into the log, and you can deal with it later by yourself

PHPzhong

requests.get has a timeout parameter.

 a = requests.get("http://www.baidu.com",timeout = 500)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template