neypro Posted February 27, 2020 Posted February 27, 2020 hello, You can help me, I use chrome selenium to login but it doesn't show the profile I created :(( #include "wd_core.au3" #include "wd_helper.au3" #include "EncodeHtmlEntities.au3" #RequireAdmin Local $sDesiredCapabilities,$sSession,$Sv_Data,$File_Error,$time_delay $user_profile='C:\\Users\\24h\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1' _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true,"args":["user-data-dir='&$user_profile&'"] }}}}' _WD_Startup() Sleep(7000) $sSession=_WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession,'https://www.google.com') _WD_LoadWait($sSession)
CYCho Posted February 27, 2020 Posted February 27, 2020 Each chromedriver session requires a unique user data directory. Please check if you have an existing Chrome browser instance using the same user data directory, in which case you should close it beforehand. zPlayer - A Small Audio and Video Player
neypro Posted February 27, 2020 Author Posted February 27, 2020 I tried working on a session but it didn't open the profile I requested
CYCho Posted February 27, 2020 Posted February 27, 2020 Your code runs fine in my computer. You said you created the profile. Does that folder (Profile 1) have exactly the same subfolders and files as in the default user data directory? If not, chromedriver will not start. You should rather specify a non-existing folder ( "user-data-dir=c:\users\profile 1", for example) and run the code so that the chrome may create the folder to suit its requirements. zPlayer - A Small Audio and Video Player
neypro Posted February 27, 2020 Author Posted February 27, 2020 the folder I created when creating a new profile in chrome default. I want to sign in to google when I enter the browser with chrome selenium
neypro Posted February 27, 2020 Author Posted February 27, 2020 I created a new profile then logged into gmail. when I open chrome selenium I didn't get that profile
neypro Posted February 27, 2020 Author Posted February 27, 2020 I can't log in to gmail when using chrome selenium, so I have to use the gmail logged in profile
CYCho Posted February 27, 2020 Posted February 27, 2020 Please check if the 2 user data directories are identical: the one created for chrome.exe and logged in to gmail and the other one used by chromedriver. You can do it by typing chrome://version in the address bar and Enter key in both browser instances. As I said above, you should close the first instance of chrome before running chromedriver. If they are identical and you still don't have the same google profile, it is beyond my comprehension. zPlayer - A Small Audio and Video Player
neypro Posted February 27, 2020 Author Posted February 27, 2020 On 2/27/2020 at 8:11 AM, CYCho said: Please check if the 2 user data directories are identical: the one created for chrome.exe and logged in to gmail and the other one used by chromedriver. You can do it by typing chrome://version in the address bar and Enter key in both browser instances. As I said above, you should close the first instance of chrome before running chromedriver. If they are identical and you still don't have the same google profile, it is beyond my comprehension. Expand Can you tell me which folder contains gmail account management data (on pc)
CYCho Posted February 27, 2020 Posted February 27, 2020 (edited) In the chrome browser where you are logged in to gmail, go to address bar and enter chrome://version + Enter. You can find the default profile directory. Edited February 27, 2020 by CYCho zPlayer - A Small Audio and Video Player
neypro Posted February 27, 2020 Author Posted February 27, 2020 perfect. I notice that google has blocked selenium access. thank you so very much
CYCho Posted February 27, 2020 Posted February 27, 2020 Please notice that user-data-dir does not include "Default" subfolder portion of the above profile directory. zPlayer - A Small Audio and Video Player
Danp2 Posted February 27, 2020 Posted February 27, 2020 FYI -- There's a FAQ section in the Webdriver Wiki entry that explains the proper way to launch Chrome with an existing profile. Latest Webdriver UDF Release Webdriver Wiki FAQs
neypro Posted February 27, 2020 Author Posted February 27, 2020 Sorry, I was in a hurry. I have solved my problem. thank you very much
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now