我正在尝试在 Manjaro Linux 上的 Python 中运行它。
我已经编写了一些我们希望在办公室的屏幕上运行的功能测试。但是,只有当我通过一个--headless
我们绝对不想要的选项时,测试才有效。否则,我们得到的恒定误差是The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.
。因此,当我传递--headless
参数时,这个错误立即消失了,这在这一点上非常令人沮丧。这是我现在正在尝试的代码:
options = Options()
options.add_argument("--no-sandbox")
options.add_argument("--window-size=1920,1080")
options.add_argument("--disable-gpu")
options.add_argument("--disable-extensions")
options.add_argument("--start-maximized")
# options.add_argument("--headless")
driver = webdriver.Chrome("/usr/bin/chromedriver", chrome_options=options)
任何提示都非常感谢!谢谢!