我对使用 scrapy shell 非常陌生。我搜索了很多但找不到 scrapy shell 中的打印命令是什么。如果你看一下下面的脚本,你就会明白我的意思。
scrapy shell http://quotes.toscrape.com/ --nolog
for item in response.css(".author"):
author_name = item.css("::text").extract_first()
print(author_name) # What should be the command to print the `author_name`.
所以,如果有人帮助我如何在 scrapy shell 中打印结果,我将不胜感激。谢谢。
请您参考如下方法:
当您在交互式 shell 中键入多行表达式时,您应该在最后一行后按两次 Enter。
检查 this answer获取有关续行的更多信息。
