Skip to content

Commit a1fd937

Browse files
committed
Update CDP Mode examples
1 parent 5186166 commit a1fd937

3 files changed

Lines changed: 15 additions & 18 deletions

File tree

examples/cdp_mode/raw_cdp_pixelscan.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
sb = sb_cdp.Chrome(guest=True, ad_block=True)
44
sb.goto("https://pixelscan.net/fingerprint-check")
5-
sb.sleep(1)
6-
sb.wait_for_element("pxlscn-dynamic-ad")
7-
sb.sleep(0.5)
8-
sb.remove_elements("pxlscn-dynamic-ad")
9-
sb.sleep(1)
5+
sb.remove_element("div.header-ad")
6+
sb.remove_element("pxlscn-dynamic-ad")
7+
sb.sleep(1.8)
108
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
11-
sb.wait_for_element("span.status-success")
129
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
10+
sb.assert_text("consistent", "span.status-success")
11+
sb.sleep(0.5)
1312
sb.highlight("span.status-success")
1413
sb.highlight("pxlscn-fingerprint-masking p")
1514
sb.highlight("pxlscn-bot-detection p")

examples/cdp_mode/raw_pixelscan.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
with SB(uc=True, test=True, guest=True) as sb:
44
sb.activate_cdp_mode(ad_block=True)
55
sb.goto("https://pixelscan.net/fingerprint-check")
6-
sb.sleep(1.5)
7-
sb.wait_for_element("pxlscn-dynamic-ad")
8-
sb.sleep(0.5)
9-
sb.remove_elements("pxlscn-dynamic-ad")
10-
sb.sleep(1.5)
6+
sb.remove_element("div.header-ad")
7+
sb.remove_element("pxlscn-dynamic-ad")
8+
sb.sleep(1.8)
119
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
12-
sb.wait_for_element("span.status-success")
1310
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
11+
sb.assert_text("consistent", "span.status-success")
12+
sb.sleep(0.5)
1413
sb.cdp.highlight("span.status-success")
1514
sb.cdp.highlight("pxlscn-fingerprint-masking p")
1615
sb.cdp.highlight("pxlscn-bot-detection p")

examples/raw_pixelscan.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
with SB(uc=True, test=True, guest=True) as sb:
44
sb.activate_cdp_mode(ad_block=True)
55
sb.goto("https://pixelscan.net/fingerprint-check")
6-
sb.sleep(1.5)
7-
sb.wait_for_element("pxlscn-dynamic-ad")
8-
sb.sleep(0.5)
9-
sb.remove_elements("pxlscn-dynamic-ad")
10-
sb.sleep(1.5)
6+
sb.remove_element("div.header-ad")
7+
sb.remove_element("pxlscn-dynamic-ad")
8+
sb.sleep(1.8)
119
sb.assert_text("No automated behavior", "pxlscn-bot-detection")
12-
sb.wait_for_element("span.status-success")
1310
sb.assert_text("No masking detected", "pxlscn-fingerprint-masking")
11+
sb.assert_text("consistent", "span.status-success")
12+
sb.sleep(0.5)
1413
sb.cdp.highlight("span.status-success")
1514
sb.cdp.highlight("pxlscn-fingerprint-masking p")
1615
sb.cdp.highlight("pxlscn-bot-detection p")

0 commit comments

Comments
 (0)