MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / main

Function main

examples/cdp_mode/raw_basic_async.py:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6async def main():
7 url = "https://seleniumbase.io/simple/login"
8 driver = await cdp_driver.start_async()
9 page = await driver.get(url, lang="en")
10 print(await page.get_title())
11 await page.type("#username", "demo_user")
12 await page.type("#password", "secret_pass")
13 await page.click("#log-in")
14 print(await page.get_title())
15 element = await page.select("h1")
16 assert element.text == "Welcome!"
17 top_nav = await page.select("div.topnav")
18 links = await top_nav.query_selector_all_async("a")
19 for nav_item in links:
20 print(nav_item.text)
21 driver.quit()
22
23if __name__ == "__main__":
24 with decorators.print_runtime("raw_basic_async.py"):

Callers 1

raw_basic_async.pyFile · 0.70

Calls 7

getMethod · 0.45
get_titleMethod · 0.45
typeMethod · 0.45
clickMethod · 0.45
selectMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…