Example: Basic Navigation
The simplest VoidCrawl use case: open a browser, navigate to a URL, and read the page.
Code
import asyncio
from voidcrawl import BrowserPool, PoolConfig
async def main() -> None: async with BrowserPool(PoolConfig()) as pool, pool.acquire() as tab: await tab.goto("https://qscrape.dev") title = await tab.title() url = await tab.url() html = await tab.content()
print(f"Title: {title}") print(f"URL: {url}") print(f"HTML length: {len(html)} chars")
if __name__ == "__main__": asyncio.run(main())What’s Happening
BrowserPool(PoolConfig())creates a pool with default settings (1 browser, 4 tabs).pool.acquire()checks out a tab from the pool.tab.goto()sends the browser to the URL and waits for network idle, returning aPageResponse. (If you want to drive the wait yourself, usetab.navigate()and pair it withwait_for_navigation()or a selector wait — both are useful but not interchangeable.)tab.title(),tab.url(), andtab.content()read page state from the live DOM.- When the
async withblock exits, the tab is released back to the pool for reuse.
Expected Output
Title: qScrapeURL: https://qscrape.dev/HTML length: 1256 chars