python webdriver_管理器chrome自定义配置文件
如何使webdriver_manager.chrome使用自定义的chrome用户配置文件 我知道对于selenium webdriver,我可以这样指定:python webdriver_管理器chrome自定义配置文件,python,selenium,webdriver,selenium-chromedriver,webdriver-manager,Python,Selenium,Webdriver,Selenium Chromedriver,Webdriver Manager,如何使webdriver_manager.chrome使用自定义的chrome用户配置文件 我知道对于selenium webdriver,我可以这样指定: options = Options() options.add_argument(f'user-data-dir={script_path}\\User Data\\profile') driver = webdriver.Chrome(executable_path=f'{script_path}\\chromedriver.exe',
options = Options()
options.add_argument(f'user-data-dir={script_path}\\User Data\\profile')
driver = webdriver.Chrome(executable_path=f'{script_path}\\chromedriver.exe', options=options)
driver = webdriver.Chrome(ChromeDriverManager().install())
但是,由于我想让chromedriver自己安装正确的版本(因为我向非python用户销售我的程序),所以我使用的是webdriver_manager模块,如下所示:
options = Options()
options.add_argument(f'user-data-dir={script_path}\\User Data\\profile')
driver = webdriver.Chrome(executable_path=f'{script_path}\\chromedriver.exe', options=options)
driver = webdriver.Chrome(ChromeDriverManager().install())
是否有任何方法可以加载自定义配置文件,以便在使用webdriver\u manager时将网站上的登录数据保存在我的配置文件中?您可以使用并同时使用以下解决方案:
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
options = Options()
options.add_argument(f'user-data-dir={script_path}\\User Data\\profile')
driver = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=options)
driver.get('https://www.google.com/')