美文网首页
Scrapy arguments

Scrapy arguments

作者: 方方块 | 来源:发表于2017-07-18 02:56 被阅读0次

    use cases - scraping isolated categories

    -a - arguments, use to replace the start_urls by override the init method and assign argument to the array element

    scrapy crawl spiderbot -a category='http://example.com/sci-fi'
    
    # overrided inside class
    def __init__ (self, category):
      self.start_urls = [category]
    

    相关文章

      网友评论

          本文标题:Scrapy arguments

          本文链接:https://www.haomeiwen.com/subject/nplckxtx.html