我正在使用 scrapy 创建一个蜘蛛,我想使用 MySQL 数据库在我的蜘蛛中获取 start_urls。现在我想知道是否可以将scrapy-cloud连接到远程数据库?
最佳答案
您可以通过重写 start_requests
蜘蛛方法来做到这一点:
http://doc.scrapy.org/en/latest/topics/spiders.html#scrapy.spiders.Spider.start_requests
您基本上可以从那里做任何您想做的事情。
scrapy云上默认安装了Mysql python。文件:http://mysql-python.sourceforge.net/
关于mysql - ScrapingHub和远程数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31516473/