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
4 changes: 2 additions & 2 deletions examples/cdp_mode/playwright/raw_footlocker_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
page.wait_for_selector(input_field)
sb.sleep(1.5)
sb.click_if_visible('button[id*="Agree"]')
sb.sleep(1.2)
sb.sleep(0.6)
page.click(input_field)
sb.sleep(0.5)
sb.sleep(0.6)
search = "Nike Shoes"
page.type(input_field, search)
sb.sleep(1.2)
Expand Down
4 changes: 2 additions & 2 deletions examples/cdp_mode/raw_cdp_clearcote.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
sb = sb_cdp.Chrome()
sb.goto("https://www.clearcotelabs.com/audit")
sb.click('button:contains("Run the audit")')
sb.sleep(5)
sb.assert_element("div.text-emerald-700", timeout=6)
sb.sleep(6)
sb.assert_element("div.text-emerald-700", timeout=8)
try:
sb.assert_text("100", "div.text-emerald-700", timeout=5)
sb.highlight('div.text-emerald-700:contains("100")')
Expand Down
10 changes: 7 additions & 3 deletions examples/cdp_mode/raw_cdp_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
print('*** Target Search for "%s":' % search)
print(' (Results must contain "%s".)' % required_text)
unique_item_text = []
items = sb.find_elements('[data-test="product-details"]')
items = sb.find_elements(
'[data-test*="ProductListing"], [data-test="product-details"]'
)
for item in items:
if required_text.lower() in item.text.lower():
description = item.query_selector('a[data-test*="Card/title"]')
description = item.query_selector('h3, a[data-test*="Card/title"]')
if description and description.text not in unique_item_text:
unique_item_text.append(description.text)
print("* " + description.text)
price = item.query_selector('[data-test="current-price"]')
price = item.query_selector(
'[style*="weight: 700;"], [data-test="current-price"]'
)
if price:
print(" (" + price.text + ")")
item.scroll_into_view()
4 changes: 2 additions & 2 deletions examples/cdp_mode/raw_footlocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
sb.goto("https://www.footlocker.com/")
sb.sleep(2.5)
sb.click_if_visible('button[id*="Agree"]')
sb.sleep(1.5)
sb.sleep(0.6)
sb.click('input[name="query"]')
sb.sleep(1.5)
sb.sleep(0.6)
search = "Nike Shoes"
sb.press_keys('input[name="query"]', search)
sb.sleep(2.5)
Expand Down
25 changes: 13 additions & 12 deletions examples/cdp_mode/raw_priceline.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@
sb.switch_to_newest_tab()
sb.sleep(0.6)
sb.sleep(0.8)
for y in range(1, 9):
sb.scroll_to_y(y * 200)
sb.sleep(0.4)
hotels = sb.find_elements('div[data-vis-key*="content"]')
titles = []
count = 0
for hotel in hotels:
title = hotel.query_selector("h3")
if title:
price = hotel.query_selector(".text-heading4")
if price:
count += 1
price_text = price.text.replace(" ", "")
print("* %s: %s => %s" % (count, title.text, price_text))
for y in range(1, 10):
sb.scroll_to_y(y * 500)
hotels = sb.find_elements('div[data-vis-key*="content"]')
for hotel in hotels:
title = hotel.query_selector("h3")
if title and title not in titles:
titles.append(title)
price = hotel.query_selector(".text-heading4")
if price:
count += 1
price_text = price.text.replace(" ", "")
print("* %s: %s => %s" % (count, title.text, price_text))
if not count:
print("No availability over the selected dates!")
2 changes: 1 addition & 1 deletion examples/cdp_mode/raw_science.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
sb.activate_cdp_mode()
sb.goto("https://earth.esa.int/eogateway/search")
sb.sleep(1)
sb.click_if_visible('button:contains("Accept cookies")')
sb.click_if_visible('button:contains("Accept cookies")', timeout=3)
for i in range(20):
sb.scroll_to_bottom()
sb.click_if_visible('button:contains("READ MORE")')
Expand Down
10 changes: 7 additions & 3 deletions examples/cdp_mode/raw_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
print('*** Target Search for "%s":' % search)
print(' (Results must contain "%s".)' % required_text)
unique_item_text = []
items = sb.find_elements('[data-test="product-details"]')
items = sb.find_elements(
'[data-test*="ProductListing"], [data-test="product-details"]'
)
for item in items:
if required_text.lower() in item.text.lower():
description = item.query_selector('a[data-test*="Card/title"]')
description = item.query_selector('h3, a[data-test*="Card/title"]')
if description and description.text not in unique_item_text:
unique_item_text.append(description.text)
print("* " + description.text)
price = item.query_selector('[data-test="current-price"]')
price = item.query_selector(
'[style*="weight: 700;"], [data-test="current-price"]'
)
if price:
print(" (" + price.text + ")")
item.scroll_into_view()
2 changes: 1 addition & 1 deletion examples/raw_invisible_captcha.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from seleniumbase import SB

with SB(uc=True, test=True, guest=True) as sb:
with SB(uc=True, test=True) as sb:
sb.activate_cdp_mode()
sb.goto("https://seleniumbase.io/apps/invisible_recaptcha")
sb.sleep(1)
Expand Down
4 changes: 2 additions & 2 deletions mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# mkdocs dependencies for generating the seleniumbase.io website
# Minimum Python version: 3.10 (for generating docs only)

regex>=2026.7.10
regex>=2026.7.19
pymdown-extensions>=10.21.3
pipdeptree>=3.1.1
pipdeptree>=4.0.0
python-dateutil>=2.8.2
click>=8.4.2
Markdown==3.10.2
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exceptiongroup>=1.3.1
websockets~=15.0.1;python_version<"3.10"
websockets>=16.1.1;python_version>="3.10"
filelock~=3.19.1;python_version<"3.10"
filelock>=3.31.0;python_version>="3.10"
filelock>=3.31.1;python_version>="3.10"
fasteners>=0.20
mycdp>=1.4.0
pynose>=1.5.5
Expand Down Expand Up @@ -66,7 +66,8 @@ pytest-rerunfailures==16.4;python_version>="3.11"
pytest-xdist==3.8.0
parameterized==0.9.0
behave==1.2.6
soupsieve~=2.8.4
soupsieve~=2.8.4;python_version<"3.10"
soupsieve~=2.9.0;python_version>="3.10"
beautifulsoup4~=4.15.0
pyotp~=2.10.0
python-xlib==0.33;platform_system=="Linux"
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.51.3"
__version__ = "4.51.4"
8 changes: 2 additions & 6 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2800,9 +2800,7 @@ def _set_chrome_options(
included_disabled_features.append("SidePanelPinning")
included_disabled_features.append("UserAgentClientHint")
included_disabled_features.append("DisableLoadExtensionCommandLineSwitch")
included_disabled_features.append("Bluetooth")
included_disabled_features.append("WebBluetooth")
included_disabled_features.append("UnifiedWebBluetooth")
included_disabled_features.append("NetworkPrediction")
included_disabled_features.append("WebAuthentication")
included_disabled_features.append("PasskeyAuth")
included_disabled_features.append("MediaRouter")
Expand Down Expand Up @@ -4833,9 +4831,7 @@ def get_local_driver(
included_disabled_features.append(
"DisableLoadExtensionCommandLineSwitch"
)
included_disabled_features.append("Bluetooth")
included_disabled_features.append("WebBluetooth")
included_disabled_features.append("UnifiedWebBluetooth")
included_disabled_features.append("NetworkPrediction")
included_disabled_features.append("WebAuthentication")
included_disabled_features.append("PasskeyAuth")
included_disabled_features.append("msAutofillEdgeCoupons")
Expand Down
9 changes: 3 additions & 6 deletions seleniumbase/core/sb_cdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,6 @@ def click(self, selector, timeout=None, scroll=True):
self.__slow_mode_pause_if_set()
element = self.find_element(selector, timeout=timeout)
tag_name = element.tag_name
current_url = self.get_current_url()

if tag_name:
tag_name = tag_name.lower().strip()
if (
Expand All @@ -894,8 +892,6 @@ def click(self, selector, timeout=None, scroll=True):
"svg",
]
and "contains(" not in selector
and "://google" not in current_url
and "://www.google" not in current_url
):
if scroll:
element.scroll_into_view()
Expand All @@ -909,9 +905,10 @@ def click(self, selector, timeout=None, scroll=True):
element.scroll_into_view()
else:
try:
self.js_scroll_into_view(selector)
except Exception:
element.scroll_into_view()
except Exception:
with suppress(Exception):
self.js_scroll_into_view(selector)
element.click() # Standard CDP click
self.__slow_mode_pause_if_set()
self.loop.run_until_complete(self.page.wait(0.2))
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/undetected/cdp_driver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __call__(self):
"OptimizationTargetPrediction,OptimizationGuideModelDownloading,"
"SidePanelPinning,UserAgentClientHint,PrivacySandboxSettings4,"
"OptimizationHintsFetching,InterestFeedContentSuggestions,"
"Bluetooth,WebBluetooth,UnifiedWebBluetooth,ComponentUpdater,"
"ComponentUpdater,NetworkPrediction,"
"DisableLoadExtensionCommandLineSwitch,WebAuthentication,"
"OmniboxUIFeedback,OmniboxPopupShortcut,PasskeyAuth,"
"MediaRouter,DialMediaRouteProvider,WebRtcHideLocalIpsWithMdns"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/undetected/cdp_driver/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ async def click_async(self):
object_id=self._remote_object.object_id,
arguments=arguments,
await_promise=True,
user_gesture=True,
user_gesture=False,
return_by_value=True,
)
)
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
'websockets~=15.0.1;python_version<"3.10"',
'websockets>=16.1.1;python_version>="3.10"',
'filelock~=3.19.1;python_version<"3.10"',
'filelock>=3.31.0;python_version>="3.10"',
'filelock>=3.31.1;python_version>="3.10"',
'fasteners>=0.20',
'mycdp>=1.4.0',
'pynose>=1.5.5',
Expand Down Expand Up @@ -230,7 +230,8 @@
'pytest-xdist==3.8.0',
'parameterized==0.9.0',
'behave==1.2.6', # Newer ones had issues
'soupsieve~=2.8.4',
'soupsieve~=2.8.4;python_version<"3.10"',
'soupsieve~=2.9.0;python_version>="3.10"',
'beautifulsoup4~=4.15.0',
'pyotp~=2.10.0',
'python-xlib==0.33;platform_system=="Linux"',
Expand Down