MCPcopy
hub / github.com/unclecode/crawl4ai / screenshot_usage

Function screenshot_usage

docs/examples/quickstart_sync.py:48–56  ·  view source on GitHub ↗
(crawler)

Source from the content-addressed store, hash-verified

46 print_result(result)
47
48def screenshot_usage(crawler):
49 cprint("\n📸 [bold cyan]Let's take a screenshot of the page![/bold cyan]")
50 result = crawler.run(url="https://www.nbcnews.com/business", screenshot=True)
51 cprint("[LOG] 📦 [bold yellow]Screenshot result:[/bold yellow]")
52 # Save the screenshot to a file
53 with open("screenshot.png", "wb") as f:
54 f.write(base64.b64decode(result.screenshot))
55 cprint("Screenshot saved to 'screenshot.png'!")
56 print_result(result)
57
58def understanding_parameters(crawler):
59 cprint("\n🧠 [bold cyan]Understanding 'bypass_cache' and 'include_raw_html' parameters:[/bold cyan]")

Callers 1

mainFunction · 0.85

Calls 3

cprintFunction · 0.85
print_resultFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…