使用Python Selenium Webdriver打开特定的Chrome配置文件问题

时间:2020-09-11 16:15:56

标签: python-3.x selenium google-chrome selenium-webdriver selenium-chromedriver

我知道表格上对此有多个问题,但似乎没有一个对我有用。

这是我当前的代码:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument(
    "user-data-dir=C:/Users/TestoW/AppData/Local/Google/Chrome/User Data/Profile 5")
driver = webdriver.Chrome(
    executable_path=r'C:/WebDrivers/chromedriver.exe', chrome_options=options)
driver.get("https://www.google.com")

要描述更多,我需要打开Profile 5并运行一个尚未创建的脚本,当我当前运行上面的代码时,它只是打开了似乎是普通的硒浏览器。我正在使用硒4 beta。

如果您知道解决方案,请将其放入真实场景(例如点击youtube.com上的按钮),并包含代码的全部。因为那是我找到的其他解决方案的主要问题。

预先感谢您,希望我们能找到解决方案!

不适用于我的地方

0 个答案:

没有答案