scrapy在命令行指定要采集的url

class MySpider(BaseSpider):

     # http://www.sharejs.com

    name = 'my_spider'   

 

    def __init__(self, *args, **kwargs):

      super(MySpider, self).__init__(*args, **kwargs)

 

      self.start_urls = [kwargs.get('start_url')]

 

 

#该代码片段来自于: http://www.sharejs.com/codes/python/8809

命令行

scrapy crawl my_spider -a start_url="http://some_url"


你可能感兴趣的:(scrapy在命令行指定要采集的url)