-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Can't for the life of me get seleniumbase to work on Ubuntu #3591
-
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
Beta Was this translation helpful? Give feedback.
All reactions
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:
- https://askubuntu.com/questions/1006753/how-to-check-if-the-x11-display-manager-is-installed
- https://stackoverflow.com/a/30120178/7058266
- https://askubuntu.com/questions/213678/how-to-install-x11-xorg
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
-
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:
- https://askubuntu.com/questions/1006753/how-to-check-if-the-x11-display-manager-is-installed
- https://stackoverflow.com/a/30120178/7058266
- https://askubuntu.com/questions/213678/how-to-install-x11-xorg
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.)
Beta Was this translation helpful? Give feedback.
All reactions
-
@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?
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1