Hello i have question for chromedriver. I want my own histories, cookies and all other things from my original chrome browser. if this is not possible how to use original chrome browser instead of driver?
Hello i have question for chromedriver. I want my own histories, cookies and all other things from my original chrome browser. if this is not possible how to use original chrome browser instead of driver?
you can use chrome profile (see below image to figure out which profile you want to launch)
Code :
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\Users\\***\\AppData\\Local\\Google\\Chrome\\User Data")
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', options=options)
driver.get("https://www.google.co.in")
Code :
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\Users\\***\\AppData\\Local\\Google\\Chrome\\User Data")
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', options=options)
driver.get("https://www.google.co.in")
You can get profile while running chrome://version/ in Google chrome.
You can import your default Chrome browser profile to be used by Selenium ChromeDriver as following:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir=C:\\Users\\yourUserFolderName\\AppData\\Local\\Google\\Chrome\\User Data\\Default")
driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe', chrome_options=options)