python - Linux下使用APScheduler 定时执行scrapy爬虫失败,本地windows执行成功
PHP中文网
PHP中文网 2017-04-18 09:18:05
0
1
1062

爬虫使用scrapy框架写的,使用脚本方式执行,配合APScheduler任务调度器定时执行,爬虫本身可以执行,只是定时执行失败,也没有报错误原因,日志见图,

这是程序执行主要代码部分

代码在windows系统可以运行,目前在Linux失败了,请问是什么原因?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
左手右手慢动作

After much fiddling and searching over the wall, I finally got it running under Linux. The first time the crawler job was scheduled, it was turned on, but the web page was not parsed. Only when it was scheduled for the second time did it start parsing and work normally. My own guess is that it is related to react.run(). When the apscheduler task scheduling framework is used in conjunction with Scrapy, it must be used under the twisted framework. When the crawler task is to be executed regularly, the parsing will not be performed for the first time, but will be parsed for the second time.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!