Chrome webdriver selenium内存错误python 3

2024-05-02 14:48:08 发布

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

你好,我试图通过创建一个脚本来测试selenium和chrome的webdriver,该脚本将浏览器打开到一个特定的站点。

下面是我的代码:

import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

def open_browser(user_string):
    browser = webdriver.Chrome()
    browser.get(user_string)

def main():
    x = input("Where would you like to open the internet to? ")
    open_browser(x)

if __name__ == '__main__':
    main()

但是,当我在shell中运行此命令时,会打开一个空白窗口几秒钟,然后关闭,我会得到以下错误:

124:63332:1022/202611.560:ERROR:persistent_memory_allocator.cc(815)]
Corruption detected in shared-memory segment.

124:60160:1022/202621.325:ERROR:shader_disk_cache.cc(237)] Failed to
create shader cache entry: -2

我不知道是什么导致了这些错误。


Tags: tofromimportbrowser脚本stringmaindef