我正在寻找一个通过HTTP请求运行scrapy脚本的示例。我打算通过GET或POST方法将url作为需要抓取的参数发送。我怎样才能做到这一点。
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试类似的事情。
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from testspiders.spiders.followall import FollowAllSpider
from scrapy.utils.project import get_project_settings
spider = FollowAllSpider(domain='url.com')
settings = get_project_settings()
crawler = Crawler(settings)
crawler.signals.connect(reactor.stop, signal=signals.spider_closed)
crawler.configure()
crawler.crawl(spider)
crawler.start()
log.start()
reactor.run()