Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/cdp_mode/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ with SB(uc=True, test=True, ad_block=True) as sb:
required_text = "Catan"
sb.cdp.press_keys('input[aria-label="Search"]', search + "\n")
sb.sleep(3.8)
if sb.is_element_visible("#px-captcha"):
sb.cdp.gui_click_and_hold("#px-captcha", 12)
sb.sleep(3.2)
if sb.is_element_visible("#px-captcha"):
sb.cdp.gui_click_and_hold("#px-captcha", 12)
sb.sleep(3.2)
sb.cdp.remove_elements('[data-testid="skyline-ad"]')
print('*** Walmart Search for "%s":' % search)
print(' (Results must contain "%s".)' % required_text)
Expand Down
4 changes: 2 additions & 2 deletions examples/cdp_mode/raw_footlocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
sb.sleep(2.5)
sb.cdp.click_if_visible('button[id*="Agree"]')
sb.sleep(1.5)
sb.cdp.mouse_click('input[aria-label="Search"]')
sb.cdp.mouse_click('input[name="query"]')
sb.sleep(1.5)
search = "Nike Shoes"
sb.cdp.press_keys('input[aria-label="Search"]', search)
sb.cdp.press_keys('input[name="query"]', search)
sb.sleep(2.5)
sb.cdp.mouse_click('ul[id*="typeahead"] li div')
sb.sleep(3.5)
Expand Down
2 changes: 1 addition & 1 deletion examples/cdp_mode/raw_indeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with SB(uc=True, test=True) as sb:
url = "https://www.indeed.com/companies/search"
sb.activate_cdp_mode(url)
search_box = 'input[data-testid="company-search-box"]'
search_box = "input#company-search"
if not sb.is_element_present(search_box):
sb.sleep(2)
sb.uc_gui_click_captcha()
Expand Down
2 changes: 2 additions & 0 deletions examples/cdp_mode/raw_theaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
with SB(uc=True, test=True, locale="en", ad_block=True) as sb:
url = "https://architectureofcities.com/roman-theaters"
sb.activate_cdp_mode(url)
sb.sleep(0.5)
sb.cdp.click_if_visible("#cn-close-notice")
sb.cdp.click_if_visible('[aria-label="Reject All"]')
sb.cdp.click_if_visible('span:contains("Continue")')
sb.sleep(1)
print("*** " + sb.cdp.get_text("h1") + " ***")
Expand Down
6 changes: 6 additions & 0 deletions examples/cdp_mode/raw_walmart.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
required_text = "Catan"
sb.cdp.press_keys('input[aria-label="Search"]', search + "\n")
sb.sleep(3.8)
if sb.is_element_visible("#px-captcha"):
sb.cdp.gui_click_and_hold("#px-captcha", 12)
sb.sleep(3.2)
if sb.is_element_visible("#px-captcha"):
sb.cdp.gui_click_and_hold("#px-captcha", 12)
sb.sleep(3.2)
sb.cdp.remove_elements('[data-testid="skyline-ad"]')
print('*** Walmart Search for "%s":' % search)
print(' (Results must contain "%s".)' % required_text)
Expand Down
3 changes: 2 additions & 1 deletion examples/cdp_mode/raw_wsform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
with SB(uc=True, test=True, locale="en", incognito=True) as sb:
url = "https://wsform.com/demo/"
sb.activate_cdp_mode(url)
sb.sleep(1)
sb.scroll_into_view("div.grid")
sb.uc_gui_click_captcha()
sb.sleep(1)
sb.sleep(2)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ setuptools~=70.2;python_version<"3.10"
setuptools>=80.9.0;python_version>="3.10"
wheel>=0.45.1
attrs>=25.3.0
certifi>=2025.8.3
certifi>=2025.10.5
exceptiongroup>=1.3.0
websockets~=13.1;python_version<"3.9"
websockets>=15.0.1;python_version>="3.9"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.42.0"
__version__ = "4.42.1"
5 changes: 4 additions & 1 deletion seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,8 @@ def _set_chrome_options(
included_disabled_features.append(item)
d_f_string = ",".join(included_disabled_features)
chrome_options.add_argument("--disable-features=%s" % d_f_string)
if proxy_auth:
chrome_options.add_argument("--test-type")
if (
is_using_uc(undetectable, browser_name)
and (
Expand All @@ -2681,7 +2683,8 @@ def _set_chrome_options(
chrome_options.add_argument("--disable-popup-blocking")
# Skip remaining options that trigger anti-bot services
return chrome_options
chrome_options.add_argument("--test-type")
if not proxy_auth:
chrome_options.add_argument("--test-type")
chrome_options.add_argument("--log-level=3")
chrome_options.add_argument("--no-first-run")
chrome_options.add_argument("--allow-insecure-localhost")
Expand Down
15 changes: 9 additions & 6 deletions seleniumbase/undetected/cdp_driver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,6 @@ def __init__(
"--disable-renderer-backgrounding",
"--disable-background-networking",
"--disable-dev-shm-usage",
"--disable-features=IsolateOrigins,site-per-process,Translate,"
"InsecureDownloadWarnings,DownloadBubble,DownloadBubbleV2,"
"OptimizationTargetPrediction,OptimizationGuideModelDownloading,"
"SidePanelPinning,UserAgentClientHint,PrivacySandboxSettings4,"
"DisableLoadExtensionCommandLineSwitch",
]

@property
Expand Down Expand Up @@ -202,7 +197,15 @@ def __call__(self):
# By the time it starts, the port is probably already taken.
args = self._default_browser_args.copy()
args += ["--user-data-dir=%s" % self.user_data_dir]
args += ["--disable-features=IsolateOrigins,site-per-process"]
args += [
"--disable-features=IsolateOrigins,site-per-process,Translate,"
"InsecureDownloadWarnings,DownloadBubble,DownloadBubbleV2,"
"OptimizationTargetPrediction,OptimizationGuideModelDownloading,"
"SidePanelPinning,UserAgentClientHint,PrivacySandboxSettings4,"
"DisableLoadExtensionCommandLineSwitch"
]
if self.proxy:
args += ["--test-type"]
args += ["--disable-session-crashed-bubble"]
if self.expert:
args += [
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
'setuptools>=80.9.0;python_version>="3.10"',
'wheel>=0.45.1',
'attrs>=25.3.0',
"certifi>=2025.8.3",
"certifi>=2025.10.5",
"exceptiongroup>=1.3.0",
'websockets~=13.1;python_version<"3.9"',
'websockets>=15.0.1;python_version>="3.9"',
Expand Down