Passing arguments to process.crawl in Scrapy python

后端 未结 3 456
囚心锁ツ
囚心锁ツ 2020-12-14 06:33

I would like to get the same result as this command line : scrapy crawl linkedin_anonymous -a first=James -a last=Bond -o output.json

My script is as follows :

3条回答
  •  死守一世寂寞
    2020-12-14 07:16

    You can do it the easy way:

    from scrapy import cmdline
    
    cmdline.execute("scrapy crawl linkedin_anonymous -a first=James -a last=Bond -o output.json".split())
    

提交回复
热议问题