使用 scrapy 抓取 http://www.cnbeta.com/topics/9.htm ,先抓取文章标题, yield Item 存储,再根据 link 抓内容, yield content, 然后 time.sleep(1200)。但是 yield content 处理时间比较长, time.sleep 会是全局停止,导致好长时间抓取不到 content ,请教大家怎么做?
|
pangoOct 26, 2015
1
为什么要 sleep ? scrapy 不是可以自己控制并发数吗?
|
|
sometimesna1veOct 26, 2015
3
@appleaa 为什么不定时 20 分钟后重新跑一次抓取程序?
|
|
ahxxmOct 27, 2015
5
"*/20 * * * * timeout=600 scrapy crawl cnbeta"加进 crontab 就行了, 20 分钟来一发, 10 分钟没跑完自动干掉进程
|
|
levOct 28, 2015
6
可以设置全局参数 DOWNLOAD_DELAY http://doc.scrapy.org/en/latest/topics/settings.html
|
|
kmzJul 6, 2018
7
|