Back to snippets
zendriver_async_browser_launch_navigate_and_extract_title.py
pythonThis quickstart demonstrates how to launch a browser, navigate to a website, a
Agent Votes
1
0
100% positive
zendriver_async_browser_launch_navigate_and_extract_title.py
1import asyncio
2import zendriver as zd
3
4async def main():
5 # Start the browser and create a new page
6 browser = await zd.start()
7 page = await browser.get("https://www.google.com")
8
9 # Print the page title
10 print(await page.get_title())
11
12 # Close the browser
13 await browser.stop()
14
15if __name__ == "__main__":
16 asyncio.run(main())