|
1 | 1 | from seleniumbase import SB |
2 | 2 |
|
3 | | -with SB(uc=True, incognito=True, test=True) as sb: |
| 3 | +with SB(uc=True, test=True, ad_block=True) as sb: |
4 | 4 | url = "https://pixelscan.net/fingerprint-check" |
5 | 5 | 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")') |
18 | 12 | 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") |
21 | 14 | sb.sleep(1) |
22 | | - sb.highlight("pxlscn-bot-detection", loops=10) |
| 15 | + sb.cdp.highlight("pxlscn-bot-detection p") |
23 | 16 | sb.sleep(2) |
0 commit comments