在使用phantomjs的过程中发生了如题目一样的报错信息,执行的为以下代码:

from selenium import webdriver
browser = webdriver.PhantomJS()
browser.get('https://www.baidu.com')
print(browser.current_url)

解决:

from selenium import webdriver
browser = webdriver.PhantomJS(executable_path=r'E:\phantomjs-2.1.1-windows\bin\phantomjs.exe')
browser.get('https://www.baidu.com')
print(browser.current_url)

selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH
参考: https://blog.csdn.net/JohinieLi/article/details/76622776

相关文章:

  • 2021-12-06
  • 2021-11-06
  • 2021-06-15
  • 2021-11-22
  • 2022-01-10
  • 2021-05-20
猜你喜欢
  • 2021-04-22
  • 2021-10-03
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案