Need to know how phantomjs execution is stopped

0 votes

I started and closed phantomjs in Python using:

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

But inspite of that, there is an instance of phantomjs in my MAC Activity Monitor. And everytime, I run the script, a new phantomjs process is created.
How do I close the instance of the driver?

May 23, 2018 in Selenium by abc_xyz
15 views

1 answer to this question.

0 votes
Actually, the .close() method is not the best way to release all resources associated with a driver instance. You can rather use .quit() method to free all resources of a driver, including exiting the executable process.
answered May 23, 2018 by sniffy_god
• 760 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Need to perform parallel execution (multiple browser sessions) with Selenium & TestNG by using @BeforeSuite

@Beforesuite annotated method runs before the testNG.XML ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,050 points
1,094 views
0 votes
1 answer

Need to wait until page is completely loaded - Selenium WebDriver

Using Thread.Sleep(); is one approach; but its ...READ MORE

answered Apr 2, 2018 in Selenium by nsv999
• 5,050 points
3,460 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
257 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
623 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
250 views
0 votes
1 answer

Need to select an IFrame with selenium (python)

Well for me, something like this worked. ...READ MORE

answered May 3, 2018 in Selenium by sniffy_god
• 760 points
721 views
0 votes
2 answers