Python Selenium WebDriver无法在新版本(2.4.9)中执行quit()

Python Selenium WebDriver无法在新版本(2.4.9)中执行quit(),python,selenium,phantomjs,Python,Selenium,Phantomjs,我刚刚注意到,今天在另一台机器上尝试运行相同的scrape脚本后,我不断收到一个错误: File "scrape.py", line 40, in scrape driver.quit() File "/Library/Python/2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 74, in quit self.service.stop() File "/Library/Python/2.7/site-pac

我刚刚注意到,今天在另一台机器上尝试运行相同的scrape脚本后,我不断收到一个错误:

File "scrape.py", line 40, in scrape
driver.quit()
File "/Library/Python/2.7/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 74, in quit
self.service.stop()
File "/Library/Python/2.7/site-packages/selenium/webdriver/common/service.py", line 124, in stop
self.process.stdout.close()
AttributeError: 'NoneType' object has no attribute 'close'
以下代码最初在我的笔记本电脑上运行良好—Python 2.7.10、Selenium 2.4.8、PhantomJS 2.0.0

最初出现错误的另一台机器运行Debian 8.2、Python 2.7.9、Selenium 2.4.9和PhantomJS 2.0.0。比较之后,我在笔记本电脑上将Selenium更新为2.4.9,并开始出现相同的错误。Selenium 2.4.8版和2.4.9版之间发生了什么变化,退出现在对我不起作用,或者我做错了什么

driver = webdriver.PhantomJS('/Users/sgloutnikov/node_modules/phantomjs2/bin/phantomjs')
driver.get(url)
try:
    onAir = str(driver.find_element_by_id("oapdt").text).splitlines()
except NoSuchElementException:
    logging.error("Error parsing element")
if driver:
    driver.quit()

刚刚跟踪到修复问题的更改,该更改是在5小时前完成的: