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
30 changes: 30 additions & 0 deletions examples/cdp_mode/playwright/raw_footlocker_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from playwright.sync_api import sync_playwright
from seleniumbase import sb_cdp

sb = sb_cdp.Chrome(locale="en", ad_block=True)
endpoint_url = sb.get_endpoint_url()

with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(endpoint_url)
context = browser.contexts[0]
page = context.pages[0]
page.goto("https://www.footlocker.com/")
input_field = 'input[name="query"]'
page.wait_for_selector(input_field)
sb.sleep(1.5)
sb.click_if_visible('button[id*="Agree"]')
sb.sleep(1.2)
page.click(input_field)
sb.sleep(0.5)
search = "Nike Shoes"
sb.press_keys(input_field, search)
sb.sleep(1.2)
page.click('ul[id*="typeahead"] li div')
sb.sleep(3.5)
elements = sb.select_all("a.ProductCard-link")
if elements:
print('**** Found results for "%s": ****' % search)
for element in elements:
print("------------------ >>>")
print("* " + element.text)
sb.sleep(2)
15 changes: 15 additions & 0 deletions examples/cdp_mode/playwright/raw_planetmc_sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from playwright.sync_api import sync_playwright
from seleniumbase import sb_cdp

sb = sb_cdp.Chrome()
endpoint_url = sb.get_endpoint_url()

with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(endpoint_url)
context = browser.contexts[0]
page = context.pages[0]
page.goto("https://www.planetminecraft.com/account/sign_in/")
sb.sleep(2)
sb.solve_captcha()
sb.wait_for_element_absent("input[disabled]")
sb.sleep(2)
17 changes: 17 additions & 0 deletions examples/cdp_mode/raw_cdp_pixelscan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from seleniumbase import sb_cdp

url = "https://pixelscan.net/fingerprint-check"
sb = sb_cdp.Chrome(url, incognito=True)
sb.remove_element("#headerBanner")
sb.wait_for_element("pxlscn-dynamic-ad")
sb.sleep(0.5)
sb.remove_elements("pxlscn-dynamic-ad")
sb.sleep(2)
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
sb.highlight('span:contains("is consistent")')
sb.sleep(1)
sb.highlight("pxlscn-fingerprint-masking p")
sb.sleep(1)
sb.highlight("pxlscn-bot-detection p")
sb.sleep(2)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pytest-rerunfailures==16.1;python_version>="3.10"
pytest-xdist==3.8.0
parameterized==0.9.0
behave==1.2.6
soupsieve~=2.8
soupsieve~=2.8.1
beautifulsoup4~=4.14.3
pyotp==2.9.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.45.3"
__version__ = "4.45.4"
1 change: 1 addition & 0 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2747,6 +2747,7 @@ def _set_chrome_options(
chrome_options.add_argument("--disable-renderer-backgrounding")
chrome_options.add_argument("--disable-backgrounding-occluded-windows")
chrome_options.add_argument("--disable-client-side-phishing-detection")
chrome_options.add_argument("--disable-device-discovery-notifications")
chrome_options.add_argument("--disable-oopr-debug-crash-dump")
chrome_options.add_argument("--disable-top-sites")
chrome_options.add_argument("--ash-no-nudges")
Expand Down
8 changes: 6 additions & 2 deletions seleniumbase/undetected/cdp_driver/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,23 @@ def __init__(
"--enable-privacy-sandbox-ads-apis",
"--safebrowsing-disable-download-protection",
'--simulate-outdated-no-au="Tue, 31 Dec 2099 23:59:59 GMT"',
"--deny-permission-prompts",
"--disable-application-cache",
"--test-type",
"--ash-no-nudges",
"--password-store=basic",
"--deny-permission-prompts",
"--disable-breakpad",
"--disable-setuid-sandbox",
"--disable-prompt-on-repost",
"--disable-application-cache",
"--disable-password-generation",
"--disable-save-password-bubble",
"--disable-single-click-autofill",
"--disable-ipc-flooding-protection",
"--disable-background-timer-throttling",
"--disable-search-engine-choice-screen",
"--disable-backgrounding-occluded-windows",
"--disable-client-side-phishing-detection",
"--disable-device-discovery-notifications",
"--disable-top-sites",
"--disable-translate",
"--dns-prefetch-disable",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
'pytest-xdist==3.8.0',
'parameterized==0.9.0',
'behave==1.2.6', # Newer ones had issues
'soupsieve~=2.8',
'soupsieve~=2.8.1',
'beautifulsoup4~=4.14.3',
'pyotp==2.9.0',
'python-xlib==0.33;platform_system=="Linux"',
Expand Down