&#使用seleniumbase(seleniumbase...)

wufei1232025-02-15python16

>我当前正在使用seleniumbase进行python中的web自动化,但是,有时我会收到“未创建的会话”错误:
>

test16.py - selenium.common.exceptions.sessionnotcreatedexception: message: session not created: cannot connect to chrome at 12...
例如,在此代码块中:

from seleniumbase import BaseCase
BaseCase.main(__name__, __file__, "--uc")

class MultipleDriversTest(BaseCase):
    def test_multiple_drivers(self):
        url1 = "https://invideo.io/perf/ga-ai-video-generator-web/?utm_source=google&utm_medium=cpc&utm_campaign=Top16_Search_Brand_Exact_EN&adset_name=InVideo&keyword=invideo&network=g&device=c&utm_term=invideo&utm_content=InVideo&matchtype=e&placement=g&campaign_id=18035330768&adset_id=140632017072&ad_id=616240030555&gad_source=1&gclid=Cj0KCQiAvvO7BhC-ARIsAGFyToWFf0L_8iqkB32qg9prKxVApsklZ8HA69LW2O0Z6XC1nbXXz9sCTTEaAinZEALw_wcB"
        driver1 = self.driver
        self.activate_cdp_mode(url1)
        url2 = "https://temp-mail.org/en"
        driver2 = self.get_new_driver(undetectable=True) # <- ERR
        self.activate_cdp_mode(url2)
        self.sleep(2)
        print(driver1.get_current_url())
        self.sleep(2)
        print(driver2.get_current_url())

我在程序试图获取第二个驱动程序时会不断收到错误。>

有人知道这可能是什么原因吗?

>

以上就是&#使用seleniumbase的详细内容,更多请关注知识资源分享宝库其它相关文章!

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。