Article From:

In scrapy, phantomjs are used in many projects. Although I have written the exit statement of driver. quit (), every time I run the program, the data is also obtained. There are still many phantomjs processes open. What is the reason? What should I doProcessing, so that every time we run off these phantomjs turn off.

Answer 0:

Turn off quit () after running.
Manual closure can kill the process ps-ef | grep JS | grep-v grep | awk-F’s {print $forgetting what the PID is} | xargx kill-9

Answer 1:

It’s not a good idea, but it can be used.
os.system(‘killall phantomjs’)This command will kill all processes named phantomjs.

Leave a Reply

Your email address will not be published. Required fields are marked *