最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - SessionNotCreatedException in Seleniumbase - Stack Overflow

programmeradmin1浏览0评论

I am currently creating a program in Python which uses the seleniumbase library for web automation. It works as intended for the most part, however, occasionally, I receive the error SessionNotCreatedException when I try to use SB or BaseCase. Does anybody know of any common causes for this exception?

(here is an example code block:)

from seleniumbase import BaseCase
from webdriver_manager.chrome import ChromeDriverManager
BaseCase.main(__name__, __file__, "--uc")
class MultipleDriversTest(BaseCase):
    def test_multiple_drivers(self):
        if self.browser == "safari":
            self.open_if_not_url("about:blank")
            print("\n  Safari doesn't support multiple drivers.")
            self.skip("Safari doesn't support multiple drivers.")
        url1 = "/?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 = ";
        driver2 = self.get_new_driver(undetectable=True)
        self.activate_cdp_mode(url2)
        self.sleep(2)
        print(driver1.get_current_url())
        self.sleep(2)
        print(driver2.get_current_url())
发布评论

评论列表(0)

  1. 暂无评论