手动终止 Scrapy 抓取 [英] Terminate Scrapy crawl manually

查看:43
本文介绍了手动终止 Scrapy 抓取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在 Scrapy 中运行蜘蛛时,在使用其他参数运行之前,我收到此错误消息:

When trying to run a spider in Scrapy, after having run it before with other parameters, I get this error message:

crawl: error: running 'scrapy crawl' with more than one spider is no longer supported

我将此解释为在某种意义上仍在运行的第一次爬网.我正在寻找某种方法来终止所有正在运行的 Scrapy 进程,以便从新的爬网开始清理.

I interpret this as the first crawl still running in some sense. I am looking for some way to terminate all running Scrapy processes, in order to start clean with a new crawl.

推荐答案

我希望您以错误的方式使用多个命令行参数.只需 scrapy crawl 就可以正常工作.如果您尝试使用多个命令行参数,您可能会错过任何说明符.

I hope you are using multiple command line parameters in wrong way. Simply scrapy crawl <spidername> will work fine. You may missed any specifiers if you are trying to use multiple command line arguments.

对于终止所有正在运行的 Scrapy 进程,在 Linux 操作系统中,您可以通过在 Linux 终端中使用以下命令简单地找出并杀死所有 Scrapy 进程

For terminating all running Scrapy processes, in Linux OS you can simply find out and kill all Scrapy processes by using the following command in Linux terminal

pkill scrapy 

Windows 操作系统请使用 Windows PsKill.

Please use Windows PsKill for Windows OS.

这篇关于手动终止 Scrapy 抓取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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