Skip to content Skip to sidebar Skip to footer

Selenium With Firefox Or Chrome Profile

I am trying to load a profile to selenium so that I don't have to keep log in to the website that selenium is about to visit. I am running it with Python on my Mac. In the Firefox

Solution 1:

I just solved the problem !

So here is my code :

from selenium import webdriver
options = webdriver.ChromeOptions() 
options.add_argument("user-data-dir=C:\\Users\\%username%\\AppData\\Local\\Google\\Chrome\\User Data 2")
driver = webdriver.Chrome(executable_path=path,options=options)
driver.get("https://www.google.com") 

The thing is, you'll get this error if there already is chrome opened on your computer !

So, i just copy / paste the folder User Data and rename the pasted one into User Data 2 so my chrome works with user data and selenium with user data 2 I guess.

I know that you've been waiting for a long time and I don't know if u still need this but here you got !!

Post a Comment for "Selenium With Firefox Or Chrome Profile"