-
|
I encountered an issue when using SeleniumBase with Codefrom seleniumbase import Driver
url = "https://www.google.com/"
search_term = "buy gift card online site:.us"
driver = Driver(browser='chrome', uc=True)
try:
driver.open(url)
print(f"Opened URL: {url}")
search_box_selector = 'textarea[name="q"]'
driver.wait_for_element(search_box_selector, timeout=15)
driver.type(search_box_selector, search_term, timeout=15)
driver.submit(search_box_selector)
print(f"Submitted search for '{search_term}'")
driver.sleep(10)
a_tags = driver.find_elements('#search a')
print(f"Found {len(a_tags)} link elements on page")
except Exception as e:
print("Error:", e)
finally:
driver.quit()Error on LinuxMy Observations
My Environment
My question is, why does this happen when I use Driver instead of SB? I am curious. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The There are lots of UC + CDP Mode examples running on Linux, such as: https://github.com/mdmintz/undetected-testing/actions/runs/21800048455/job/62893966876#step:17:1
|
Beta Was this translation helpful? Give feedback.

The
Driver()format doesn't have the specialXvfbvirtual display code that's needed when running on a GUI-less Linux machine.Instead, you should use the
SB()format when running UC Mode on a GUI-less Linux machine.There are lots of UC + CDP Mode examples running on Linux, such as: https://github.com/mdmintz/undetected-testing/actions/runs/21800048455/job/62893966876#step:17:1