Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Can't for the life of me get seleniumbase to work on Ubuntu #3591

Answered by mdmintz
SebastienBolh asked this question in Q&A
Discussion options

First off, thank you mdmintz for working so hard on this tool. I tried a million things to fly undetected and nothing worked until seleniumbase with UC mode. The below script is almost straight from the docs, except I duplicated the line sb.uc_gui_click_captcha() a couple times and added logging.

from seleniumbase import SB
import logging
logging.basicConfig(level=logging.DEBUG)
with SB(uc=True) as sb:
 url = "https://gitlab.com/users/sign_in"
 sb.activate_cdp_mode(url)
 sb.uc_gui_click_captcha()
 sb.sleep(2)
 sb.uc_gui_click_captcha()
 sb.sleep(2)

I'll leave out the details of the million things I tried to get my larger project working on Ubuntu, as if I can get this working, I can get everything else working too.

This works fine on mac. I put it on Ubuntu (on prem infra), install all the dependencies (including google-chrome-stable), and run it python3 test3.py.

Expected result: Google chrome opens and we nav to Gitlab, captcha is clicked, captcha is bypassed
Actual result:
Google chrome opens and we nav to Gitlab, then the DEBUG dump output.txt.

I can't tell whats wrong and I'm not sure where to look to debug or fix it.

Do you know whats wrong? Do you need more information?

Thank you,

  • Seb
You must be logged in to vote

For the X11 display failed!, that's a duplicate of #3404, #3060, and #2982.

Check the following to find out if your Linux distribution is missing X11 display dependencies:


When everything is configured properly on Ubuntu, things work. Eg:
https://github.com/mdmintz/undetected-testing/actions/runs/13695318069/job/38296312083
(GitHub Actions Ubuntu machines come with the X11 display dependencies.)

Replies: 1 comment 3 replies

Comment options

For the X11 display failed!, that's a duplicate of #3404, #3060, and #2982.

Check the following to find out if your Linux distribution is missing X11 display dependencies:


When everything is configured properly on Ubuntu, things work. Eg:
https://github.com/mdmintz/undetected-testing/actions/runs/13695318069/job/38296312083
(GitHub Actions Ubuntu machines come with the X11 display dependencies.)

You must be logged in to vote
3 replies
Comment options

@mdmintz Thank you for the prompt reply. I read those issues and the links you sent.

After installing a bunch of different packages, especially xvfb, and adding headed=True (after xvfb installation it seems to default to headless) to the script:

from seleniumbase import SB
import logging
logging.basicConfig(level=logging.DEBUG)
with SB(uc=True, headed=True) as sb:
 url = "https://gitlab.com/users/sign_in"
 sb.activate_cdp_mode(url)
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()

I've added sleeps in between with the same results.

The website opens, the cloudflare turnstyle appears, then there does not seem to be any click action, instead I get this
output.txt. This is on a fresh Ubuntu instance on xorg, google-chrome is installed and never opened (besides by seleniumbase).

I read the whole output.txt and I don't see anything I can recognize as a problem.

Any idea what I could be missing here?

Comment options

Worth noting if I use Driver:

from seleniumbase import Driver
import logging
logging.basicConfig(level=logging.DEBUG)
with Driver(uc=True, headed=True) as sb:
 url = "https://gitlab.com/users/sign_in"
 sb.uc_open_with_reconnect(url)
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()
 sb.uc_gui_click_captcha()

The only new behavior is that now it automatically attempts to refresh the page. But it still won't click the turnstyle.

The output is as such: outputDriver.txt

Comment options

It's probably related to PyAutoGUI on Linux:
https://github.com/search?q=repo%3Aasweigart%2Fpyautogui+linux&type=issues
It's working fine on my Linux machine, so you should probably check out the troubleshooting from the PyAutoGUI repo directly.

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /