web scraping - Scrapy run from Python -


i trying run scrapy python. i'm looking @ code (source):

from twisted.internet import reactor scrapy.crawler import crawler scrapy.settings import settings scrapy import log testspiders.spiders.followall import followallspider  spider = followallspider(domain='scrapinghub.com') crawler = crawler(settings()) crawler.configure() crawler.crawl(spider) crawler.start() log.start() reactor.run() # script block here 

my issue i'm confused on how adjust code run own spider. have called spider project "spider_a" specifies domain crawl within spider itself.

what asking is, if run spider following code:

scrapy crawl spider_a 

how adjust example python code above same?

just import , pass crawler.crawl(), like:

from testspiders.spiders.spider_a import myspider  spider = myspider() crawler.crawl(spider) 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -