169 questions
0
votes
0
answers
105
views
How to convert a selenium driver to seleniumbase CDP driver?
I am trying to convert a selenium driver to seleniumbase CDP driver as codes below:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opts = Options()
opts....
0
votes
1
answer
77
views
How to add session ID to Cookies once for seleniumbase test session?
I used to use pure Selenium previously and back then I added Cookie to my webdriver object in webdriver init fixture like this:
@pytest.fixture(scope="session")
def webdriver_fixture(...
0
votes
0
answers
45
views
selenium find_elements
on this page I am trying to find list of href elements (see picture).
With
links = sb.find_elements(By.XPATH, "//div[@class='dropdownPanel']/a")
I found many more results. But when i try ...
1
vote
1
answer
56
views
How to correctly loop over multiple elements in SeleniumBase?
Suppose I have multiple div elements like the following:
<div style="background-color:#FFF4A3;">
<h2>London</h2>
<p>London is the capital city of England.</p&...
0
votes
1
answer
112
views
Python Selenium find nested element [closed]
on this page I want to parse few elements.
I would like to get text in circles and use attribute value to click sometimes.
That code returns anything. With this code I want to get all attribute ...
3
votes
1
answer
88
views
Using SeleniumBase to wait for an image to become visible
I have a table header element:
<th><input type="image" src="../../..//images/icons/cell_state_header_icon.png" onclick="javascript:__doPostBack('ctl00$left_pane$...
2
votes
2
answers
127
views
Is there a way to specifiy a portable chrome version executable in seleniumbase in python 3
Nothing needed sorry for thepost
1
vote
1
answer
85
views
Weird characters in Shell after importing seleniumbase [closed]
I have a small annoyance with seleniumbase: after importing it, printing to the Shell window will always add strange characters like "[0m" for some reason. See the image to show what I mean. ...
0
votes
1
answer
53
views
SeleniumBase usage
We have a long-running process that creates RemoteWebDriver and works with Chrome browser; it is destroyed (.close() and .quit()) when needed.
Now we're planning to migrate to SeleniumBase, and I ...
0
votes
2
answers
160
views
SeleniumBase click on button via text within it using XPATH
I am currently writing a program in Python using SeleniumBase, however, I want to click a button via the text inside it and it is not working. This is an example code block:
from seleniumbase import ...
0
votes
1
answer
287
views
How to use uc_gui_click_captcha() in sb_cdp
How do I use uc_gui_click_captcha when using sb_cdp? It's possible with the context manager but how do I do it with sb_cdp?
from seleniumbase import sb_cdp
url = "https://example.com"
sb = ...
0
votes
2
answers
433
views
How to handle proxies authentication pop-up using seleniumbase
I'm trying to use an authenticated proxy with seleniumbase (I'm using python) while running the browser in undetected Chrome (uc=True). However, despite trying multiple approaches, I'm unable to get ...
1
vote
1
answer
70
views
SeleniumBase not entering @ in email field when logging into a website
I am trying to log in to apollo.io using seleniumbase.
When I open the page the program should enter the email, password and click the log in button, but for some reason it doesn't enter the @ in the ...
2
votes
2
answers
334
views
How to use oxylabs proxy in seleniumbase?
Currently I built a script using seleniumbase. It works well, but due to the website policy, I had to use proxy.
I purchased a premium proxy from oxylabs.io and generated this kind of endpoint:
...
1
vote
0
answers
110
views
SeleniumBase disable download notifications
I'm using SeleniumBase in headless mode with xvfb support:
with SB(uc=True, headless=True, xvfb=True) as sb:
...
I have no Chrome window but sometimes I can see Download complete messages. What I'...
0
votes
1
answer
447
views
Trying to use chrome with seleniumbase and uc=true option
I am trying to scrape a site that has a cloudflare bot check I currently use
import undetected_chromedriver as uc
and portable CHROME.EXE
however this seems to not get me around the bot check , so ...
0
votes
1
answer
57
views
Printing progress bar during scenario for step that might take awhile
I am using behave 1.2.6 in Python via seleniumbase to test changes to our IAM system. I have a scenario like the following:
Scenario Outline: Create User
Given Open User Creation Page
And ...
0
votes
1
answer
106
views
SeleniumBase empty html when using proxy on ubuntu
On the local computer, SeleniumBase works correctly with the proxy argument passed, but on ubuntu it outputs an empty html document with the proxy argument. Below I attach the code of the simplest ...
0
votes
1
answer
365
views
SeleniumBase in CDP mode - how to disable network?
When using SeleniumBase in CDP mode, I am trying to disable the network before I do some custom parsing stuff.
I have tried sb.execute_cdp_cmd('Network.disable', {}) but it doesn't seem to do anything ...
0
votes
0
answers
79
views
In SeleniumBase using sb, how to disable video from loading and playing?
The below simple example shows my problem. The link:
https://finance.yahoo.com/
contains a video which autoplays. It's not an mp4 or similar video file. I think it's a stream. I am trying to prevent ...
1
vote
1
answer
505
views
SeleniumBase CDP mode execute_script and evaluate with javascript gives error "SyntaxError: Illegal return statement"
I am using SeleniumBase in CDP Mode.
I am having a hard time figuring out if this a python issue or SeleniumBase issue.
The below simple example shows my problem:
from seleniumbase import SB
with SB(...
0
votes
1
answer
245
views
SeleniumBased in CDP Mode fails web driver fingerprint
The below example:
from seleniumbase import SB
with SB(uc=True, locale_code="en", headless=True) as sb:
link = "https://antoinevastel.com/bots/"
print(f"\nOpening {link}...
1
vote
1
answer
303
views
How to set window size in Selenium Base in CDP Mode?
I am using SeleniumBase in CDP Mode.
I am trying to figure out how to set the window size in CDP Mode AFTER the website is loaded?
If I use the non CDP function sb.set_window_size(x,y), then it gets ...
1
vote
1
answer
98
views
WebGL not supported by browser in Seleniumbase
I'm experimenting with the seleniumbase recorder:
from seleniumbase import BaseCase
BaseCase.main(__name__, __file__)
class RecorderTest(BaseCase):
def test_recording(self):
...
0
votes
0
answers
100
views
SessionNotCreatedException in Seleniumbase
I am currently creating a program in Python which uses the seleniumbase library for web automation. It works as intended for the most part, however, occasionally, I receive the error ...
0
votes
1
answer
239
views
Seleniumbase Python does not pass captcha on Linux ubuntu
I have the following script in Python but when the page loads the captcha does not work
Can someone help me?
On Windows I have this code that works well for me but on Linux it doesn't work for me
...
2
votes
1
answer
220
views
Seleniumbase Python not passing detection on Linux
I have the following script in Python but when the page loads the captcha does not work
Can someone help me?
On Windows I have this code that works well for me but on Linux it doesn't work for me
...
1
vote
1
answer
810
views
Seleniumbase CDP mode opening new tabs
I am currently writing a python program which uses a seleniumbase web bot with CDP mode activated:
with SB(uc=True, test=True, xvfb=True, incognito=True, agent=<user_agent>, headless=True) as sb:...
0
votes
0
answers
189
views
Why does SeleniumBase in UC mode fail to find the driver path in a .exe built with PyInstaller?
I am using SeleniumBase in UC mode to launch a website. When I run my script as a .py file in PyCharm, it works fine. However, after converting it to an .exe file using PyInstaller and running the ....
1
vote
0
answers
57
views
SeleniumBase Driver Initialization Fails with Gunicorn + Nginx, but Works Manually with Flask
Description:
I am experiencing an issue where the SeleniumBase Driver initialization works perfectly when the code is executed manually using python3, or when Flask is run manually. However, when the ...
1
vote
0
answers
72
views
Using seleniumbase get_page_source() to retrieve current html after button is clicked
The following is a seleniumbase python script I'm working on, and need some advice on how to use the get_page_source() method. The second print(html) is not correct because the screen changed, and it ...
0
votes
0
answers
61
views
How to use seleniumbase in Streamlit cloud
There are a few ressources on how to run selenium in Streamlit cloud with chromium, and this example with google-chrome-stable. But I couldn't find any specific instructions for seleniumbase.
...
1
vote
2
answers
289
views
Seleniumbase not logging
I am trying to capture responses using Selenium and undetected, this is working normally using those two:
import undetected_chromedriver as uc
capabilities = DesiredCapabilities.CHROME
capabilities[&...
1
vote
1
answer
415
views
Driver works with undetected_chromedriver but not with seleniumbase
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....
0
votes
1
answer
620
views
SeleniumBase UC can't resolve captcha in Docker but work in local
I’m using SeleniumBase with Undetected ChromeDriver (UC) to bypass captchas. The script works perfectly on my macOS (local machine) using Chrome. However, when I run the same code inside a Docker ...
1
vote
1
answer
483
views
SeleniumBase with xvfb and headless Chrome gets stuck on Ubuntu VM but works fine locally on Windows
I'm working on a web scraping script using SeleniumBase on an Ubuntu virtual machine (VM), and I'm running into issues with headless mode and xvfb. This script works perfectly on my local Windows ...
0
votes
0
answers
134
views
'user_multi_procs=True' with seleniumbase
I am writing an application in python which is currently using undetected-chromedriver for a web bot. I am trying to switch to seleniumbase, by creating a 'Driver' object.
My driver at the moment ...
2
votes
1
answer
380
views
Use seleniumbase in UC mode in google colab
Is it possible to launch seleniumbase in UC mode in google colab?
I ran the cell with this code (no other cells were ran with that colab runtime before):
!sudo apt update && sudo apt upgrade
!...
0
votes
1
answer
138
views
Script Works in Non-Headless Mode but Fails in Headless Mode with "Element Not Found" Error
I'm using SeleniumBase in Python to automate interactions on a webpage. My script runs perfectly in non-headless mode, but when I set it to headless (headless=True or headless2=True), it fails to find ...
0
votes
0
answers
125
views
Issues with SeleniumBase Script – Intermittent Failures Despite Page Consistency
I'm using Selenium to scrape service reading data from the Servipag website with a script that retries up to 5 times in case of errors. The page structure hasn't changed, and this function was ...
1
vote
0
answers
37
views
Dockerized Selenium script freezes on element location
I'm trying to host my scraper on the cloud using a docker file since I can't install a desktop env on my vps. I can't find any examples for seleniumbase and it must run in headful mode for the ...
0
votes
0
answers
60
views
How can Selenium (python) fail to see an element if I can see it in dev tools?
This is a general question about selenium.
When I open the dev tools on a certain website and search for an Xpath, I can locate the elements I'm looking for, so I know the Xpath is valid and does what ...
1
vote
0
answers
205
views
How can I reuse a SeleniumBase driver instance across multiple scripts in UC (Undetected Chrome) mode?
I'm currently using SeleniumBase with UC mode to launch a web page. After starting a browser instance in one script, I would like to reuse that instance in another script within the same project. ...
1
vote
0
answers
150
views
My seleniumbase code stopped working even though I didn't change anything
I'm still a beginner in coding and I wrote a simple script to scrape some data from a real estate website and it worked just fine for a few weeks, but now it simply stopped working because it can't ...
1
vote
0
answers
3k
views
Problem with Chrome 130 / Undetected Chromedriver / Python / Selenium
I crossposted this to the UC github discussions:
I'm a hack hobbyist so please forgive my lack of codiing skills.
Yesterday my chromedriver and uc (I think) updated and I'm now getting a Timeout ...
0
votes
1
answer
245
views
Seleniumbase page_source error, I can't get the html code
I run the newest seleniumbase. I need the uc mode for the login and etc.
I got this only after the newest chromium released (130).
driver = Driver(uc_cdp=True, incognito=True)'
driver.get("https:...
2
votes
1
answer
325
views
scrapy spider using seleniumbase middleware scraping 'chrome-extension' URLs that weren't requested
I'm currently running a scrapy spider using a seleniumbase middleware and for some reason it is scraping chrome-extension URLs. I'm scraping the https://www.atptour.com website and at no point does my ...
0
votes
1
answer
1k
views
How to enable a virtual display with headless mode in seleniumbase?
with SB(uc=True, Headless=True) as sb:
for url in urls:
sb.uc_open_with_reconnect(url, 5)
sb.uc_gui_handle_captcha()
time.sleep(2)
has_next_page = True
I'm facing ...
1
vote
1
answer
561
views
SeleniumBase won't bypass a Cloudflare CAPTCHA in headless mode
I attempted to scrape a website that has a bot-blocker from cloudflare using this code:
with SB(uc=True, headless2=True) as sb:
for url in urls:
sb.uc_open_with_reconnect(url, 5)
...
0
votes
1
answer
102
views
Python Script Works from Command Line but Fails When Called from C# in IIS
I have a MVC application written in C# and hosted on IIS. In my C# code, I am trying to call a Python script to access the Scopus website and retrieve user information. The Python script works ...