I want open Google Chrome, like its self, the chromedriver open it without my cookies, my passwords, my history and all that staff. i tried to play with the option, and search all over the web for solution, didn't got one, plus i tried
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options
opt = webdriver.ChromeOptions()
opt.add_arguments("--user-data-dir=C:\Users\Bar\AppData\Local\Google\Chrome\User Data")
driver = webdriver.Chrome(opt)
driver.get("https://www.google.com/")
but it didn't work it says:
C:\Users\Bar\AppData\Local\Programs\Python\Python35-32\python.exe C:/Users/Bar/PycharmProjects/yad2/Webdriver.py
File "C:/Users/Bar/PycharmProjects/yad2/Webdriver.py", line 7
opt.add_arguments("--user-data-dir=C:\Users\Bar\AppData\Local\Google\Chrome\User Data")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 18-19: truncated \UXXXXXXXX escape
Process finished with exit code 1
--and try asopt.add_arguments("user-data-dir=C:\Users\Bar\AppData\Local\Google\Chrome\User Data")- Saurabh GaurTraceback (most recent call last): File "C:/Users/Bar/PycharmProjects/yad2/Webdriver.py", line 6, in <module> opt.add_arguments(r"user-data-dir=C:\Users\Bar\AppData\Local\Google\Chrome\User Data") AttributeError: 'Options' object has no attribute 'add_arguments'- UnityNewb