Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I can't open chrome with a profile

I try to open a tab with a profile but I get this error

WebDriver.init() got multiple values for argument ‘options’

from selenium import webdriver
from selenium.webdriver import ChromeOptions

PATH = "chromedriver.exe"
url = "https://web.whatsapp.com/"
options = ChromeOptions()
options.add_argument("user-data-dir = C:\\Users\\omer\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1")

Driver = webdriver.Chrome(PATH,options=options)
Driver.get(url) ```

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You have to use Service class now to pass the executable_path

Check the below code:

from selenium import webdriver
from selenium.webdriver import ChromeOptions
from selenium.webdriver.chrome.service import Service

service = Service(executable_path="C:/<fullpath>/chromedriver.exe")
url = "https://web.whatsapp.com/"
options = ChromeOptions()
options.add_argument("user-data-dir = C:\\Users\\omer\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1")

Driver = webdriver.Chrome(service=service,options=options)
Driver.get(url)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading