SeleniumBase behaving differently on Linux then on Windows #3161
-
Basically I am logging into snapchat with seleniumbase and it works perfectly in headless mode on windows, the way it works is I have 3 steps. 1st step inputs a username, 2nd step it clicks the next button then it goes to password input, then 3rd step it inputs password and finally 4th step it clicks button to sign in. For some reason on Linux it reaches the password page , it inputs the text but when I click the next button it doesnt log user in. And the page which I am suppose to be on is not present. I have bunch of print methods which are giving me info about the pages so thats how I can see whats currently present. Here is my code below: `
` So the web driver gets initialized, it passed the first two steps..but then it doesn't pass the 3rd one..it works well on windows so I know its not the element error or whatever, also my credentials are hardcoded for this case so that is correct as well. I know this is not a new case but I would really like some input on this. Any help is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
UC Mode doesn't really support headless mode anymore because UC Mode uses Instead of using headless mode on Linux, use If you encounter a CF CAPTCHA, you'll need to use If you run your script with |
Beta Was this translation helpful? Give feedback.
-
So I tried the xvfb before and I am getting error of X11 display failed! Will use regular xvfb and then it just freezes.. and my code where I use it:
But either way, you say UC mode doesnt support headless but my driver still gets initiated and it goes to type in the username and goes to password page..so I would assume that driver wouldn't even be initiated if that was the case or am I wrong? |
Beta Was this translation helpful? Give feedback.
UC Mode doesn't really support headless mode anymore because UC Mode uses
PyAutoGUI
for lots of things, which doesn't work with a headless browser. (You don't need headless mode on Linux anymore because of the special virtual display that's included.)Instead of using headless mode on Linux, use
xvfb=True
to activate the virtual display.If you encounter a CF CAPTCHA, you'll need to use
sb.uc_gui_click_captcha()
.If you run your script with
--debug
on the command-line, it prints out the coordinates clicked viasb.uc_gui_click_captcha()
. With those coordinates, you can callsb.uc_gui_click_x_y(x, y)
from a disconnected state (discussed in the UC Mode docs), which avoids an extra page refre…