diff --git a/examples/cdp_mode/playwright/raw_footlocker_sync.py b/examples/cdp_mode/playwright/raw_footlocker_sync.py new file mode 100644 index 00000000000..43e9ccfd8cf --- /dev/null +++ b/examples/cdp_mode/playwright/raw_footlocker_sync.py @@ -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) diff --git a/examples/cdp_mode/playwright/raw_planetmc_sync.py b/examples/cdp_mode/playwright/raw_planetmc_sync.py new file mode 100644 index 00000000000..13cd14c3d4d --- /dev/null +++ b/examples/cdp_mode/playwright/raw_planetmc_sync.py @@ -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) diff --git a/examples/cdp_mode/raw_cdp_pixelscan.py b/examples/cdp_mode/raw_cdp_pixelscan.py new file mode 100644 index 00000000000..f1b404ea0b6 --- /dev/null +++ b/examples/cdp_mode/raw_cdp_pixelscan.py @@ -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) diff --git a/requirements.txt b/requirements.txt index ea8ff4efc2f..53cc6c7fc1b 100755 --- a/requirements.txt +++ b/requirements.txt @@ -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" diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index 6e1c962f3c1..d21577b51b9 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "4.45.3" +__version__ = "4.45.4" diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index c3607b640e3..098d3d434b6 100644 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -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") diff --git a/seleniumbase/undetected/cdp_driver/config.py b/seleniumbase/undetected/cdp_driver/config.py index e80d053e848..866ea2bdd69 100644 --- a/seleniumbase/undetected/cdp_driver/config.py +++ b/seleniumbase/undetected/cdp_driver/config.py @@ -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", diff --git a/setup.py b/setup.py index 3bbca50b308..ac197bf6b27 100755 --- a/setup.py +++ b/setup.py @@ -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"',