Created
March 21, 2014 08:39
-
-
Save 8maki/9682074 to your computer and use it in GitHub Desktop.
ScrapyをScriptから実行する際のスクリプト ref: http://qiita.com/8maki/items/62b39130c116d3844c1c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spider = FollowAllSpider(domain='scrapinghub.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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spider = FollowAllSpider(domain='scrapinghub.com') | |
settings = get_project_settings() | |
crawler = Crawler(settings) | |
crawler.signals.connect(reactor.stop, signal=signals.spider_closed) | |
log.start_from_crawler(crawler) | |
crawler.configure() | |
crawler.crawl(spider) | |
crawler.start() | |
reactor.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_from_crawler(crawler): | |
return start_from_settings(crawler.settings, crawler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def start_from_crawler(crawler): | |
return start_from_settings(crawler.settings, crawler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment