How to save Scrapy crawl Command output

后端 未结 7 1778
太阳男子
太阳男子 2021-02-01 10:06

I am trying to save the output of the scrapy crawl command I have tried scrapy crawl someSpider -o some.json -t json >> some.text But it doesn\'t worked ...c

7条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 10:38

    You need to redirect stderr too. You are redirecting only stdout. You can redirect it somehow like this:

    scrapy crawl someSpider -o some.json -t json 2> some.text

    The key is number 2, which "selects" stderr as source for redirection.

    If you would like to redirect both stderr and stdout into one file, you can use:

    scrapy crawl someSpider -o some.json -t json &> some.text

    For more about output redirection: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

提交回复
热议问题