Selenium Chromedriver无法在Python、Centos Cpanel服务器中运行

wtzytmuj  于 2022-11-07  发布在  Python
关注(0)|答案(1)|浏览(187)

我安装了selenium和chrome驱动程序。
然后我创建了下面的代码来运行它:

from pyvirtualdisplay import Display
 from selenium import webdriver
 chromedriver = "/usr/bin/chromedriver"
 driver = webdriver.Chrome(chromedriver)
 driver.get(url)
 html = driver.page_source
 driver.quit()
 display.stop()

该代码产生以下错误:“”chromedriver.exe“可执行文件必须位于PATH中.请参阅https://sites.google.com/a/chromium.org/chromedriver/home
路径是正确的。我已经尝试了一些代码的变体,但它们都产生相同的消息。我的webhost声称你不能在安装了cpanel的centos服务器上安装selenium。这是真的吗?还是我的代码有什么问题?

相关问题