无法连接到Ghostdriver

时间:2015-12-06 11:30:52

标签: python selenium web-scraping

我希望从动态网站中提取一些信息。

from selenium import webdriver
import time

driver = webdriver.PhantomJS(executable_path='/Users/xxx/anaconda/phantomjs-2.0.0-macosx/bin/phantomjs')
driver.get("http://pythonscraping.com/pages/javascript/ajaxDemo.html")
time.sleep(3)
print(driver.find_element_by_id("content").text)
driver.close()

当我运行上面的代码时,我收到以下错误消息:

"selenium.common.exceptions.WebDriverException: Message: 
Can not connect to GhostDriver on port 61121"

任何想法为什么?

0 个答案:

没有答案