Skip to content

Commit afef6b8

Browse files
committed
Add Stealthy Playwright examples for BrowserScan
1 parent 9cc818b commit afef6b8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from playwright.sync_api import sync_playwright
2+
from seleniumbase import SB
3+
4+
with SB(uc=True, locale="en") as sb:
5+
sb.activate_cdp_mode()
6+
endpoint_url = sb.cdp.get_endpoint_url()
7+
8+
with sync_playwright() as p:
9+
browser = p.chromium.connect_over_cdp(endpoint_url)
10+
page = browser.contexts[0].pages[0]
11+
page.goto("https://www.browserscan.net/bot-detection")
12+
page.wait_for_timeout(1000)
13+
sb.cdp.flash("Test Results", duration=4)
14+
page.wait_for_timeout(1000)
15+
sb.assert_element('strong:contains("Normal")')
16+
sb.cdp.flash('strong:contains("Normal")', duration=4, pause=4)
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(locale="en")
5+
endpoint_url = sb.get_endpoint_url()
6+
7+
with sync_playwright() as p:
8+
browser = p.chromium.connect_over_cdp(endpoint_url)
9+
page = browser.contexts[0].pages[0]
10+
page.goto("https://www.browserscan.net/bot-detection")
11+
page.wait_for_timeout(1000)
12+
sb.flash("Test Results", duration=4)
13+
page.wait_for_timeout(1000)
14+
sb.assert_element('strong:contains("Normal")')
15+
sb.flash('strong:contains("Normal")', duration=4, pause=4)

0 commit comments

Comments
 (0)