Python 如何以Root用户或超级用户身份在Selenium中执行Firefox webdriver

Python 如何以Root用户或超级用户身份在Selenium中执行Firefox webdriver,python,selenium,webdriver,geckodriver,selenium-firefoxdriver,Python,Selenium,Webdriver,Geckodriver,Selenium Firefoxdriver,我试图在Ubuntu服务器上执行一个python脚本,在Selenium中启动一个Firefox webdriver 我需要作为超级用户执行此操作,因为脚本启动VPN并且需要权限。如果我在没有超级用户权限的情况下执行脚本,它会工作 如何使用权限执行此脚本 作为超级用户执行时会弹出此错误: selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process 谢

我试图在Ubuntu服务器上执行一个python脚本,在Selenium中启动一个Firefox webdriver

我需要作为超级用户执行此操作,因为脚本启动VPN并且需要权限。如果我在没有超级用户权限的情况下执行脚本,它会工作

如何使用权限执行此脚本

作为超级用户执行时会弹出此错误:

selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process

谢谢

你使用virtualenv还是anaconda?不,我没有使用virtualenv或conda。