I initiated and close
from selenium import webdriver
driver = webdriver.PhantomJS()
html_doc = driver.page_source
.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.