-
Hello guys, I need a way to stop the specific instance of the advertools crawler with Python instead of using the CTRL + C, I need to do it through Python script, is there a way?Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Short answer, run this from the command line: kill -9 $(ps -A | grep 'scrapy runspider' | cut -f 2 -d ' ' | head -n 1) Long answer:
The result is the process ID we are looking for. Then |
Beta Was this translation helpful? Give feedback.
-
The challenge remains: which spider are you stopping? What if you are running multiple spiders at the same time? |
Beta Was this translation helpful? Give feedback.
-
Hey Elias! This is the solution to track the specific Spider on Windows, I built script: import platform, psutil class SpiderTracker:
|
Beta Was this translation helpful? Give feedback.
Hey Elias! This is the solution to track the specific Spider on Windows, I built script:
import platform, psutil
import pandas as pd
class SpiderTracker: