Skip to content

Commit 7a9dad2

Browse files
committed
Update examples
1 parent 798d516 commit 7a9dad2

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

examples/cdp_mode/raw_pixelscan.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
from seleniumbase import SB
22

3-
with SB(uc=True, incognito=True, test=True) as sb:
3+
with SB(uc=True, test=True, ad_block=True) as sb:
44
url = "https://pixelscan.net/fingerprint-check"
55
sb.activate_cdp_mode(url)
6-
sb.sleep(3)
7-
sb.remove_elements(".bg-bannerBg") # Remove top banner
8-
sb.remove_elements("pxlscn-ad1") # Remove an ad banner
9-
sb.remove_elements("pxlscn-ad2") # Remove an ad banner
10-
sb.remove_elements("jdiv") # Remove chat widgets
11-
not_masking_text = "You are not masking your fingerprint"
12-
fp_selector = "pxlscn-fingerprint-masking"
13-
sb.assert_text(not_masking_text, fp_selector, timeout=15)
14-
no_automation_detected = "No automation framework detected"
15-
sb.assert_text(no_automation_detected, "pxlscn-bot-detection")
16-
consistent_selector = 'div.bg-consistentBg [alt="Good"]'
17-
sb.highlight(consistent_selector, loops=8)
6+
sb.remove_element("#headerBanner")
7+
sb.remove_elements("pxlscn-dynamic-ad")
8+
sb.sleep(2)
9+
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
10+
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
11+
sb.cdp.highlight('span:contains("is consistent")')
1812
sb.sleep(1)
19-
fingerprint_masking_div = "pxlscn-fingerprint-masking div"
20-
sb.highlight(fingerprint_masking_div, loops=9)
13+
sb.cdp.highlight("pxlscn-fingerprint-masking p")
2114
sb.sleep(1)
22-
sb.highlight("pxlscn-bot-detection", loops=10)
15+
sb.cdp.highlight("pxlscn-bot-detection p")
2316
sb.sleep(2)

examples/raw_pixelscan.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
from seleniumbase import SB
22

3-
with SB(uc=True, incognito=True, test=True) as sb:
3+
with SB(uc=True, test=True, ad_block=True) as sb:
44
url = "https://pixelscan.net/fingerprint-check"
55
sb.activate_cdp_mode(url)
6-
sb.sleep(3)
7-
sb.remove_elements(".bg-bannerBg") # Remove top banner
8-
sb.remove_elements("pxlscn-ad1") # Remove an ad banner
9-
sb.remove_elements("pxlscn-ad2") # Remove an ad banner
10-
sb.remove_elements("jdiv") # Remove chat widgets
11-
not_masking_text = "You are not masking your fingerprint"
12-
fp_selector = "pxlscn-fingerprint-masking"
13-
sb.assert_text(not_masking_text, fp_selector, timeout=15)
14-
no_automation_detected = "No automation framework detected"
15-
sb.assert_text(no_automation_detected, "pxlscn-bot-detection")
16-
consistent_selector = 'div.bg-consistentBg [alt="Good"]'
17-
sb.highlight(consistent_selector, loops=8)
6+
sb.remove_element("#headerBanner")
7+
sb.remove_elements("pxlscn-dynamic-ad")
8+
sb.sleep(2)
9+
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
10+
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
11+
sb.cdp.highlight('span:contains("is consistent")')
1812
sb.sleep(1)
19-
fingerprint_masking_div = "pxlscn-fingerprint-masking div"
20-
sb.highlight(fingerprint_masking_div, loops=9)
13+
sb.cdp.highlight("pxlscn-fingerprint-masking p")
2114
sb.sleep(1)
22-
sb.highlight("pxlscn-bot-detection", loops=10)
15+
sb.cdp.highlight("pxlscn-bot-detection p")
2316
sb.sleep(2)

0 commit comments

Comments
 (0)