-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathraw_basic_async.py
More file actions
22 lines (17 loc) · 701 Bytes
/
Copy pathraw_basic_async.py
File metadata and controls
22 lines (17 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import asyncio
from playwright.async_api import async_playwright
from seleniumbase import cdp_driver
async def main():
driver = await cdp_driver.start_async()
endpoint_url = driver.get_endpoint_url()
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp(endpoint_url)
page = browser.contexts[0].pages[0]
await page.goto("https://seleniumbase.io/simple/login")
await page.fill("#username", "demo_user")
await page.fill("#password", "secret_pass")
await page.click("#log-in")
await page.wait_for_selector("h1")
await page.wait_for_timeout(1000)
if __name__ == "__main__":
asyncio.run(main())

