admin管理员组

文章数量:1130349

 # 设置ChromeDriver的路径

        chrome_driver_path = r'E:\python_code\MyDemo\ZhongHe\bin\chromedriver.exe'  # 替换为你的ChromeDriver路径

        # 创建ChromeOptions对象

        chrome_options = webdriver.ChromeOptions()

        chrome_options.add_argument('ignore-certificate-errors')

        out_path = os.getcwd() + r'.\download'  # 是你想指定的下载路径

        prefs = {'profile.default_content_settings.popups': 0, 'download.default_directory': out_path}

        chrome_options.add_experimental_option('prefs', prefs)

        chrome_options.add_experimental_option('excludeSwitches',['enable-logging'])

        chrome_options.binary_location = r'E:\安装包\360极速浏览器\360ChromeX\Chrome\Application\360ChromeX.exe'  # 替换为360极速浏览器的实际路径

        # 创建Service对象

        service = Service(chrome_driver_path)

        # 初始化WebDriver

        self.driver = webdriver.Chrome(service=service, options=chrome_options)

 # 设置ChromeDriver的路径

        chrome_driver_path = r'E:\python_code\MyDemo\ZhongHe\bin\chromedriver.exe'  # 替换为你的ChromeDriver路径

        # 创建ChromeOptions对象

        chrome_options = webdriver.ChromeOptions()

        chrome_options.add_argument('ignore-certificate-errors')

        out_path = os.getcwd() + r'.\download'  # 是你想指定的下载路径

        prefs = {'profile.default_content_settings.popups': 0, 'download.default_directory': out_path}

        chrome_options.add_experimental_option('prefs', prefs)

        chrome_options.add_experimental_option('excludeSwitches',['enable-logging'])

        chrome_options.binary_location = r'E:\安装包\360极速浏览器\360ChromeX\Chrome\Application\360ChromeX.exe'  # 替换为360极速浏览器的实际路径

        # 创建Service对象

        service = Service(chrome_driver_path)

        # 初始化WebDriver

        self.driver = webdriver.Chrome(service=service, options=chrome_options)

本文标签: 极速浏览器selenium