Skip to content

Commit 7d11416

Browse files
authored
Merge pull request #4177 from seleniumbase/cdp-mode-patch-85
CDP Mode: Patch 85
2 parents d00fba0 + 0f4c44b commit 7d11416

File tree

8 files changed

+72
-5
lines changed

8 files changed

+72
-5
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from playwright.sync_api import sync_playwright
2+
from seleniumbase import sb_cdp
3+
4+
sb = sb_cdp.Chrome(locale="en", ad_block=True)
5+
endpoint_url = sb.get_endpoint_url()
6+
7+
with sync_playwright() as p:
8+
browser = p.chromium.connect_over_cdp(endpoint_url)
9+
context = browser.contexts[0]
10+
page = context.pages[0]
11+
page.goto("https://www.footlocker.com/")
12+
input_field = 'input[name="query"]'
13+
page.wait_for_selector(input_field)
14+
sb.sleep(1.5)
15+
sb.click_if_visible('button[id*="Agree"]')
16+
sb.sleep(1.2)
17+
page.click(input_field)
18+
sb.sleep(0.5)
19+
search = "Nike Shoes"
20+
sb.press_keys(input_field, search)
21+
sb.sleep(1.2)
22+
page.click('ul[id*="typeahead"] li div')
23+
sb.sleep(3.5)
24+
elements = sb.select_all("a.ProductCard-link")
25+
if elements:
26+
print('**** Found results for "%s": ****' % search)
27+
for element in elements:
28+
print("------------------ >>>")
29+
print("* " + element.text)
30+
sb.sleep(2)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from playwright.sync_api import sync_playwright
2+
from seleniumbase import sb_cdp
3+
4+
sb = sb_cdp.Chrome()
5+
endpoint_url = sb.get_endpoint_url()
6+
7+
with sync_playwright() as p:
8+
browser = p.chromium.connect_over_cdp(endpoint_url)
9+
context = browser.contexts[0]
10+
page = context.pages[0]
11+
page.goto("https://www.planetminecraft.com/account/sign_in/")
12+
sb.sleep(2)
13+
sb.solve_captcha()
14+
sb.wait_for_element_absent("input[disabled]")
15+
sb.sleep(2)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from seleniumbase import sb_cdp
2+
3+
url = "https://pixelscan.net/fingerprint-check"
4+
sb = sb_cdp.Chrome(url, incognito=True)
5+
sb.remove_element("#headerBanner")
6+
sb.wait_for_element("pxlscn-dynamic-ad")
7+
sb.sleep(0.5)
8+
sb.remove_elements("pxlscn-dynamic-ad")
9+
sb.sleep(2)
10+
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
11+
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
12+
sb.highlight('span:contains("is consistent")')
13+
sb.sleep(1)
14+
sb.highlight("pxlscn-fingerprint-masking p")
15+
sb.sleep(1)
16+
sb.highlight("pxlscn-bot-detection p")
17+
sb.sleep(2)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pytest-rerunfailures==16.1;python_version>="3.10"
6262
pytest-xdist==3.8.0
6363
parameterized==0.9.0
6464
behave==1.2.6
65-
soupsieve~=2.8
65+
soupsieve~=2.8.1
6666
beautifulsoup4~=4.14.3
6767
pyotp==2.9.0
6868
python-xlib==0.33;platform_system=="Linux"

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.45.3"
2+
__version__ = "4.45.4"

seleniumbase/core/browser_launcher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,7 @@ def _set_chrome_options(
27472747
chrome_options.add_argument("--disable-renderer-backgrounding")
27482748
chrome_options.add_argument("--disable-backgrounding-occluded-windows")
27492749
chrome_options.add_argument("--disable-client-side-phishing-detection")
2750+
chrome_options.add_argument("--disable-device-discovery-notifications")
27502751
chrome_options.add_argument("--disable-oopr-debug-crash-dump")
27512752
chrome_options.add_argument("--disable-top-sites")
27522753
chrome_options.add_argument("--ash-no-nudges")

seleniumbase/undetected/cdp_driver/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,23 @@ def __init__(
187187
"--enable-privacy-sandbox-ads-apis",
188188
"--safebrowsing-disable-download-protection",
189189
'--simulate-outdated-no-au="Tue, 31 Dec 2099 23:59:59 GMT"',
190-
"--deny-permission-prompts",
191-
"--disable-application-cache",
192190
"--test-type",
193191
"--ash-no-nudges",
192+
"--password-store=basic",
193+
"--deny-permission-prompts",
194194
"--disable-breakpad",
195195
"--disable-setuid-sandbox",
196196
"--disable-prompt-on-repost",
197+
"--disable-application-cache",
197198
"--disable-password-generation",
199+
"--disable-save-password-bubble",
200+
"--disable-single-click-autofill",
198201
"--disable-ipc-flooding-protection",
199202
"--disable-background-timer-throttling",
200203
"--disable-search-engine-choice-screen",
201204
"--disable-backgrounding-occluded-windows",
202205
"--disable-client-side-phishing-detection",
206+
"--disable-device-discovery-notifications",
203207
"--disable-top-sites",
204208
"--disable-translate",
205209
"--dns-prefetch-disable",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
'pytest-xdist==3.8.0',
211211
'parameterized==0.9.0',
212212
'behave==1.2.6', # Newer ones had issues
213-
'soupsieve~=2.8',
213+
'soupsieve~=2.8.1',
214214
'beautifulsoup4~=4.14.3',
215215
'pyotp==2.9.0',
216216
'python-xlib==0.33;platform_system=="Linux"',

0 commit comments

Comments
 (0)