Open Profile in Chrome Selenium
To fix this, change the add_argument
line to (removing the spaces in the string):
CH_Option.add_argument("user-data-dir=C:/Users/Ali/AppData/Local/Google/Chrome/User Data/Default")
How to use certain Chrome profile with selenium python?
First of all
update your ChromeDriver to the latest version
(This part is mandatory).
Then pass two arguments --profile-directory=Profile 1
and user-data-dir=C:\\Users\\user123\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 16
to the Chrome binary
options = Options()
options.add_argument('--profile-directory=Profile 16')
options.add_argument("user-data-dir=C:\\Users\\Hana\\AppData\\Local\\Google\\Chrome\\User Data\\") #Path to your chrome profile
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe", options=options)
Note that in user-data-dir
you should only pass the path of all profiles then the name of specific profile (Here, Profile 16) should be passed through --profile-directory
You can check out full source code named PythonChromeProfile in SeleniumWebDriver-Tiny_projects on Github, Which I tested successfuly. Also you can read about creating Chrome profiles and find the path to that profile Here
Related Topics
How to Handle Both a Single Item and an Array For the Same Property Using Json.Net
Cs0120: an Object Reference Is Required For the Nonstatic Field, Method, or Property 'Foo'
Encrypt and Decrypt a String in C#
Send Http Post Request in .Net
How to Do a Deep Copy of an Object in .Net
Understanding Garbage Collection in .Net
How to Enable Assembly Bind Failure Logging (Fusion) in .Net
Linq'S Distinct() on a Particular Property
How to Call Asynchronous Method from Synchronous Method in C#
What Is the Correct Way to Create a Single-Instance Wpf Application
What Are the Differences Between a Multidimensional Array and an Array of Arrays in C#
Fastest Way of Inserting in Entity Framework
Parse Datetime With Time Zone of Form Pst/Cest/Utc/Etc
What Is an "Index Out of Range" Exception, and How to Fix It
What Are Your Favorite Extension Methods For C# (Codeplex.Com/Extensionoverflow)
What Do Two Question Marks Together Mean in C#