如何在Debian9上安装SeleniumWebDriverforPython3?

2024-06-01 12:07:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我花了大约6个小时来安装Selenium。我认为我的各种错误源于版本兼容性或缺少必备的软件包。我在OpenVZ VPS上使用Debian9服务器廉价.net. 这个VPS没有预装很多包,所以我必须手动安装python之类的东西。有没有人能写一个在debian9的新版本上安装python3selenium的分步过程?请指定哪些webdriver和版本号。你知道吗

至于我犯的错误,这里有几个:

Message: 'geckodriver' executable needs to be in PATH
Message: invalid argument: can't kill an exited process
Message: Process unexpectedly closed with status 1
Message: Service chromedriver unexpectedly exited. Status code was: 127

我希望能够无错误地运行以下Python3脚本:

from selenium import webdriver
browser = webdriver.Firefox() #or webdriver.Chrome()

Tags: 版本服务器messagenetvpsselenium错误手动