程序卡在创建 driver 个实例

Program stuck at creating driver instance

我有一个使用线程的程序,它同时打开多个 drivers,并且都在进行不同的在线搜索。 但是当我启动 运行 程序时,有些 driver 工作正常,但有些 driver 会卡在创建 driver 实例阶段。

那些 driver 永远停留在那里。

这是 driver 停止的代码:

browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)

知道哪里出了问题吗?或者有什么方法可以找出问题所在?由于程序卡在那里,我不知道如何从中获取错误。 创建 drivers 的整个函数如下:

for driver_threads in range(Driver_Count):
    Driver_Creation = Thread(target=createDriverInstance,args=(driver_threads,"Hide"))
    Driver_Creation.start()

def createDriverInstance(driver_threads, display):
    chrome_options = Options()
    chrome_options.binary_location=chrome_binary_location # I have declare the location somewhere
    if(display=="Hide"):
        chrome_options.add_argument('--headless')
        chrome_options.add_argument('--disable-gpu')
    chrome_options.add_argument("--log-level=3")
    chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
    browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
    return browser

更改当前浏览器变量 收件人:

browser =  webdriver.Chrome(options=chrome_options)

这个 我认为这是因为它正在尝试下载 chromedriver 所以 :)))