My script I have been writing has been working great. I just added the option so it would open a profile on chrome using this code.
options = webdriver.ChromeOptions
browser = webdriver.Chrome(executable_path=r"C:UsersprincessAppDataLocalProgramsPythonPython36-32chromedriver.exe", chrome_options=options)
options.add_argument(r'user-data-dir=C:UsersprincessAppDataLocalGoogleChromeUser Data')
options.add_argument('--profile-directory=Profile 1')
When used, I get this error code.
C:UsersPrincessDesktop>CHBO.py
Traceback (most recent call last):
File "C:UsersPrincessDesktopCHBO.py", line 12, in <module>
browser = webdriver.Chrome(executable_path=r"C:UsersprincessAppDataLocalProgramsPythonPython36-32chromedriver.exe", chrome_options=options)
File "C:UsersPrincessAppDataLocalProgramsPythonPython36-32libsite-packagesseleniumwebdriverchromewebdriver.py", line 59, in __init__
desired_capabilities = options.to_capabilities()
TypeError: to_capabilities() missing 1 required positional argument: 'self'
How can I fix this?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…