How to properly stop phantomjs execution

0
0

I initiated and close phantomjs in Python with the following

from selenium import webdriver    
driver
= webdriver.PhantomJS()
driver
.get(url)
html_doc
= driver.page_source
driver
.close()

yet after the script ends execution I still find an instance of phantomjs in my Mac Activity Monitor. And actually every time I run the script a new process phantomjs is created.

How should I close the driver?

  • You must to post comments
0
0

The .close() method is not guaranteed to release all resources associated with a driver instance. Note that these resources include, but may not be limited to, the driver executable (PhantomJS, in this case). The .quit() method is designed to free all resources of a driver, including exiting the executable process.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website