0

I wanted to access logins in my chrome profile but every time i try to access it, the window opens correctly but no further action gets performed like opening the link or anything. The code crashes. I tried using both selenium and Undetected Browser but no use:

import undetected_chromedriver as webdriver
import time

profile = "C:/Users/user1/AppData/Local/Google/Chrome/User Data/"

# Chrome options
options = webdriver.ChromeOptions()
options.add_argument(f"--user-data-dir={profile}")
options.add_argument("--profile-directory=Profile 29")
    # WebDriver Control Experimental Options
try:
    driver = webdriver.Chrome(options=options)
    time.sleep(3)
    print("start")
    driver.get("https://www.youtube.com")
    print("hello")
    driver.maximize_window()
except Exception as e:
    print("Failed to load:", e)
    driver = None

time.sleep(10)
if driver:
    driver.quit()

This is what i get in terminal:

Failed to load: Message: session not created: cannot connect to chrome at 127.0.0.1:63134
from chrome not reachable
Stacktrace:
        GetHandleVerifier [0x0xd64553+62419]
        GetHandleVerifier [0x0xd64594+62484]
        (No symbol) [0x0xba1f90]
        (No symbol) [0x0xb95f3a]
        (No symbol) [0x0xbdae76]
        (No symbol) [0x0xbd132f]
        (No symbol) [0x0xbd1166]
        (No symbol) [0x0xc1af3e]
        (No symbol) [0x0xc1a82a]
        (No symbol) [0x0xc0f266]
        (No symbol) [0x0xbde852]
        (No symbol) [0x0xbdf6f4]
        GetHandleVerifier [0x0xfd4833+2619059]
        GetHandleVerifier [0x0xfcfc4a+2599626]
        GetHandleVerifier [0x0xd8b0fa+221050]
        GetHandleVerifier [0x0xd7b378+156152]
        GetHandleVerifier [0x0xd81d2d+183213]
        GetHandleVerifier [0x0xd6c438+94904]
        GetHandleVerifier [0x0xd6c5c2+95298]
        GetHandleVerifier [0x0xd5771a+9626]
        BaseThreadInitThunk [0x0x756dfcc9+25]
        RtlGetAppContainerNamedObjectPath [0x0x772682ae+286]
        RtlGetAppContainerNamedObjectPath [0x0x7726827e+238]
1
  • Your code works fine with regular Selenium. undetected_chromedriver is out of date, unmaintained, and not likely to work well with newer versions of Selenium and Chrome. Commented Jul 3 at 22:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.