Skip to content

Commit 3cf1eaf

Browse files
committed
Update examples
1 parent c6958db commit 3cf1eaf

File tree

4 files changed

+14
-20
lines changed

4 files changed

+14
-20
lines changed

examples/cdp_mode/raw_cdp_nike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
sb = sb_cdp.Chrome(url)
55
sb.click('div[data-testid="user-tools-container"]')
66
sb.sleep(1)
7-
search = "Road Racing Shoes"
7+
search = "Pegasus"
88
sb.press_keys('input[type="search"]', search)
99
sb.sleep(4)
1010
elements = sb.select_all('ul[data-testid*="products"] figure .details')

examples/cdp_mode/raw_chatgpt.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
sb.activate_cdp_mode(url)
77
sb.sleep(1)
88
sb.click_if_visible('button[aria-label="Close dialog"]')
9+
sb.click_if_visible('button[data-testid="close-button"]')
910
query = "Compare Playwright to SeleniumBase in under 178 words"
1011
sb.press_keys("#prompt-textarea", query)
1112
sb.click('button[data-testid="send-button"]')

examples/cdp_mode/raw_pixelscan.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
from seleniumbase import SB
22

33
with SB(uc=True, incognito=True, test=True) as sb:
4-
sb.activate_cdp_mode("https://pixelscan.net/")
5-
sb.sleep(2)
6-
sb.click('button[class*="startButton"]')
7-
sb.sleep(6)
4+
url = "https://pixelscan.net/fingerprint-check"
5+
sb.activate_cdp_mode(url)
6+
sb.sleep(3)
87
sb.remove_elements(".bg-bannerBg") # Remove top banner
98
sb.remove_elements("pxlscn-ad1") # Remove an ad banner
109
sb.remove_elements("pxlscn-ad2") # Remove an ad banner
1110
sb.remove_elements("jdiv") # Remove chat widgets
12-
sb.sleep(14)
1311
not_masking_text = "You are not masking your fingerprint"
14-
sb.assert_text(
15-
not_masking_text,
16-
"pxlscn-fingerprint-masking",
17-
timeout=20,
18-
)
12+
fp_selector = "pxlscn-fingerprint-masking"
13+
sb.assert_text(not_masking_text, fp_selector, timeout=15)
1914
no_automation_detected = "No automation framework detected"
2015
sb.assert_text(no_automation_detected, "pxlscn-bot-detection")
2116
consistent_selector = 'div.bg-consistentBg [alt="Good"]'

examples/raw_pixelscan.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
from seleniumbase import SB
22

33
with SB(uc=True, incognito=True, test=True) as sb:
4-
sb.driver.uc_open_with_reconnect("https://pixelscan.net/", 2)
5-
sb.uc_click('button[class*="startButton"]', reconnect_time=20)
4+
url = "https://pixelscan.net/fingerprint-check"
5+
sb.driver.uc_open_with_reconnect(url, 7)
66
sb.remove_elements(".bg-bannerBg") # Remove top banner
77
sb.remove_elements("pxlscn-ad1") # Remove an ad banner
88
sb.remove_elements("pxlscn-ad2") # Remove an ad banner
99
sb.remove_elements("jdiv") # Remove chat widgets
10-
no_automation_detected = "No automation framework detected"
11-
sb.assert_text(
12-
no_automation_detected,
13-
"pxlscn-bot-detection",
14-
timeout=20,
15-
)
1610
not_masking_text = "You are not masking your fingerprint"
17-
sb.assert_text(not_masking_text, "pxlscn-fingerprint-masking")
11+
fp_selector = "pxlscn-fingerprint-masking"
12+
sb.assert_text(not_masking_text, fp_selector, timeout=15)
13+
no_automation_detected = "No automation framework detected"
14+
sb.assert_text(no_automation_detected, "pxlscn-bot-detection")
15+
consistent_selector = 'div.bg-consistentBg [alt="Good"]'
1816
consistent_selector = 'div.bg-consistentBg [alt="Good"]'
1917
sb.highlight(consistent_selector, loops=8, scroll=False)
2018
sb.sleep(1)

0 commit comments

Comments
 (0)