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: 5 additions & 1 deletion examples/cdp_mode/playwright/raw_walmart_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
item = items.nth(i)
if required_text in item.inner_text():
description = item.locator('[data-automation-id="product-title"]')
if description and description.inner_text() not in unique_item:
if (
description
and description.is_visible()
and description.inner_text() not in unique_item
):
unique_item.append(description.inner_text())
print("* " + description.inner_text())
price = item.locator('[data-automation-id="product-price"]')
Expand Down
4 changes: 2 additions & 2 deletions mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ click==8.3.1
ghp-import==2.1.0
watchdog==6.0.0
cairocffi==1.7.1
pathspec==1.0.3
Babel==2.17.0
pathspec==1.0.4
Babel==2.18.0
paginate==0.5.7
mkdocs==1.6.1
mkdocs-material==9.6.23
Expand Down
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip>=25.3
pip>=26.0
packaging>=26.0
setuptools~=70.2;python_version<"3.10"
setuptools>=80.10.2;python_version>="3.10"
Expand Down Expand Up @@ -45,7 +45,8 @@ wsproto~=1.3.2;python_version>="3.10"
websocket-client~=1.9.0
selenium==4.32.0;python_version<"3.10"
selenium==4.40.0;python_version>="3.10"
cssselect==1.3.0
cssselect==1.3.0;python_version<"3.10"
cssselect>=1.4.0,<2;python_version>="3.10"
nest-asyncio==1.6.0
sortedcontainers==2.4.0
execnet==2.1.1;python_version<"3.10"
Expand All @@ -71,7 +72,7 @@ PyAutoGUI>=0.9.54;platform_system=="Linux"
markdown-it-py==3.0.0;python_version<"3.10"
markdown-it-py==4.0.0;python_version>="3.10"
mdurl==0.1.2
rich>=14.3.1,<15
rich>=14.3.2,<15

# --- Testing Requirements --- #
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
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.46.2"
__version__ = "4.46.3"
12 changes: 9 additions & 3 deletions seleniumbase/core/sb_cdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,10 @@ def _on_a_cf_turnstile_page(self, source=None):

def _on_an_incapsula_hcaptcha_page(self, *args, **kwargs):
self.loop.run_until_complete(self.page.wait())
if self.is_element_visible('iframe[src*="_Incapsula_Resource?"]'):
if (
self.is_element_visible('iframe[src*="_Incapsula_Resource?"]')
or self.is_element_visible("iframe[data-hcaptcha-widget-id]")
):
return True
return False

Expand Down Expand Up @@ -2052,13 +2055,16 @@ def __gui_click_recaptcha(self, use_cdp=False):
return False

def __cdp_click_incapsula_hcaptcha(self):
selector = None
selector = "iframe[data-hcaptcha-widget-id]"
if self.is_element_visible('iframe[src*="_Incapsula_Resource?"]'):
outer_selector = 'iframe[src*="_Incapsula_Resource?"]'
selector = "iframe[data-hcaptcha-widget-id]"
element = self.get_nested_element(outer_selector, selector)
if not element:
return False
elif self.is_element_visible(selector):
element = self.select(selector, timeout=0.1)
if not element:
return False
else:
return False
time.sleep(0.05)
Expand Down
16 changes: 14 additions & 2 deletions seleniumbase/undetected/cdp_driver/cdp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,18 @@ async def start(
sb_config.disable_csp = True
if "binary_location" in kwargs and not browser_executable_path:
browser_executable_path = kwargs["binary_location"]
if not user_data_dir and "--user-data-dir" in arg_join:
udd_string = None
if "--user-data-dir=" in arg_join:
udd_string = arg_join.split("--user-data-dir=")[1].split(" ")[0]
elif "--user-data-dir " in arg_join:
udd_string = arg_join.split("--user-data-dir ")[1].split(" ")[0]
if udd_string:
if udd_string.startswith('"') and udd_string.endswith('"'):
udd_string = udd_string[1:-1]
elif udd_string.startswith("'") and udd_string.endswith("'"):
udd_string = udd_string[1:-1]
user_data_dir = udd_string
if not browser_executable_path:
browser = None
if "browser" in kwargs:
Expand All @@ -611,9 +623,9 @@ async def start(
br_string = arg_join.split("--browser ")[1].split(" ")[0]
if br_string:
if br_string.startswith('"') and br_string.endswith('"'):
br_string = proxy_string[1:-1]
br_string = br_string[1:-1]
elif br_string.startswith("'") and br_string.endswith("'"):
br_string = proxy_string[1:-1]
br_string = br_string[1:-1]
browser = br_string
if not browser:
if "--edge" in sys_argv:
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
],
python_requires=">=3.9",
install_requires=[
'pip>=25.3',
'pip>=26.0',
'packaging>=26.0',
'setuptools~=70.2;python_version<"3.10"', # Newer ones had issues
'setuptools>=80.10.2;python_version>="3.10"',
Expand Down Expand Up @@ -193,7 +193,8 @@
'websocket-client~=1.9.0',
'selenium==4.32.0;python_version<"3.10"',
'selenium==4.40.0;python_version>="3.10"',
'cssselect==1.3.0',
'cssselect==1.3.0;python_version<"3.10"',
'cssselect>=1.4.0,<2;python_version>="3.10"',
'nest-asyncio==1.6.0',
'sortedcontainers==2.4.0',
'execnet==2.1.1;python_version<"3.10"',
Expand All @@ -219,7 +220,7 @@
'markdown-it-py==3.0.0;python_version<"3.10"',
'markdown-it-py==4.0.0;python_version>="3.10"',
'mdurl==0.1.2',
'rich>=14.3.1,<15',
'rich>=14.3.2,<15',
],
extras_require={
# pip install -e .[allure]
Expand Down Expand Up @@ -261,7 +262,7 @@
"pdfminer": [
'pdfminer.six==20251107;python_version<"3.10"',
'pdfminer.six==20260107;python_version>="3.10"',
'cryptography==46.0.3',
'cryptography==46.0.4',
'cffi==2.0.0',
'pycparser==2.23;python_version<"3.10"',
'pycparser==3.0;python_version>="3.10"',
Expand All @@ -287,11 +288,11 @@
# pip install -e .[playwright]
# (For the Playwright integration.)
"playwright": [
"playwright>=1.56.0",
"playwright>=1.58.0",
],
# pip install -e .[psutil]
"psutil": [
"psutil>=7.1.3",
"psutil>=7.2.2",
],
# pip install -e .[pyautogui]
# (Already a required dependency on Linux now.)
Expand Down