1

I am currently creating an application which involves 2 webdrivers. One webdriver uses the undetected_chromedriver library and one uses seleniumbase in UC mode:

driver1 = undetected_chromedriver.Chrome(use_subprocess=True, user_multi_procs=True, headless=True)
driver2 = seleniumbase.Driver(uc=True, headless2=True, uc_subprocess=True, incognito=True)

driver1 works fine, however, when attempting to run driver2, sometimes I receive the following error:

session not created: cannot connect to chrome at 127.0.0.1:63728
from chrome not reachable
Stacktrace:
    GetHandleVerifier [0x00007FF7DA6E2775+28773]
    (No symbol) [0x00007FF7DA64AFB0]
    (No symbol) [0x00007FF7DA4E5359]
    (No symbol) [0x00007FF7DA4D6ECD]
    (No symbol) [0x00007FF7DA5260A2]
    (No symbol) [0x00007FF7DA51B025]
    (No symbol) [0x00007FF7DA56A2DC]
    (No symbol) [0x00007FF7DA5698C0]
    (No symbol) [0x00007FF7DA55ED43]
    (No symbol) [0x00007FF7DA52A548]
    (No symbol) [0x00007FF7DA52B6B1]
    GetHandleVerifier [0x00007FF7DAA0F45D+3358029]
    GetHandleVerifier [0x00007FF7DAA2430D+3443709]
    GetHandleVerifier [0x00007FF7DAA183FD+3394797]
    GetHandleVerifier [0x00007FF7DA7A929B+842635]
    (No symbol) [0x00007FF7DA65654F]
    (No symbol) [0x00007FF7DA651FA4]
    (No symbol) [0x00007FF7DA65213D]
    (No symbol) [0x00007FF7DA641629]
    BaseThreadInitThunk [0x00007FFF9BD27374+20]
    RtlUserThreadStart [0x00007FFF9CF9CC91+33]

I have looked for solutions but have had no success, does anybody know why I am receiving this error?

1 Answer 1

1

For Linux, you'll want Xvfb instead of Headless Mode.

Use the SB() context manager format:

from seleniumbase import SB

with SB(uc=True, test=True, xvfb=True, incognito=True) as sb:
    sb.activate_cdp_mode(URL)

If using CDP Mode (which is stealthier than regular UC Mode), you'll want to use the sb.cdp methods. Examples in SeleniumBase/examples/cdp_mode.

Otherwise (if using regular UC Mode), then don't activate CDP Mode.

You can access the raw driver methods from regular UC Mode with sb.driver.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, what should I do if I am using Windows?
On Windows, there's a GUI. Use a regular, visible browser.

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.