Scrapy 覆盖 json 文件而不是附加文件 [英] Scrapy overwrite json files instead of appending the file

查看:29
本文介绍了Scrapy 覆盖 json 文件而不是附加文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法覆盖上述文件而不是附加它?

Is there a way to overwrite the said file instead of appending it?

示例)

scrapy crawl myspider -o "/path/to/json/my.json" -t json    
scrapy crawl myspider -o "/path/to/json/my.json" -t json

将附加 my.json 文件而不是覆盖它.

Will append the my.json file instead of overwrite it.

推荐答案

scrapy crawl myspider -t json --nolog -o - > "/path/to/json/my.json"

这篇关于Scrapy 覆盖 json 文件而不是附加文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆