Using SeleniumBase in UC mode #2322
-
Hi,
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Many of your questions may already be answered in the UC Mode video tutorial: https://www.youtube.com/watch?v=5dMFI3e85ig SeleniumBase fixes the user agent in headless mode by swapping If you want to set a Here are a few of the UC Mode methods: (More are covered in the video) driver.uc_open_with_reconnect(url, reconnect_time=None)
driver.uc_click(selector) Here are some examples of UC Mode scripts:
Here's are some newer UC Mode examples where clicking is required:
(There are 23 SeleniumBase Syntax Formats for structuring scripts.) Most methods scroll automatically on most pages. There are also some specialized scroll methods: self.scroll_to(selector)
self.slow_scroll_to(selector)
self.scroll_into_view(selector)
self.scroll_to_top()
self.scroll_to_bottom() |
Beta Was this translation helpful? Give feedback.
Many of your questions may already be answered in the UC Mode video tutorial:
https://www.youtube.com/watch?v=5dMFI3e85ig
SeleniumBase fixes the user agent in headless mode by swapping
HeadlessChrome
with justChrome
. Otherwise, Chrome uses the natural browser's user agent, which is the best way to go because changing that could lead to an inconsistency with the browser's natural fingerprint (which can get you detected).If you want to set a
user_data_dir
, you can. This lets you keep a Chrome profile between tests. But be sure you never mix a UC Modeuser_data_dir
with one that is used by a regular Chrome instance, because that will get you detected.Here are a few of the UC Mode methods…