Add interactive asciinema demos 🎬
- Created demo_basic_usage.py showing Crawailer vs requests - Created demo_claude_integration.py for MCP server showcase - Recorded asciinema sessions for both demos - Added demo viewing instructions to README - Provides interactive way to see Crawailer in action - Perfect for developers who want to see before installing
This commit is contained in:
parent
fad0b60b66
commit
cffd04e4ca
5 changed files with 194 additions and 0 deletions
58
demo_basic_usage.py
Normal file
58
demo_basic_usage.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Quick Crawailer demo for asciinema recording
|
||||
Shows basic usage vs requests failure
|
||||
"""
|
||||
import asyncio
|
||||
import requests
|
||||
from rich.console import Console
|
||||
from rich.panel import Panel
|
||||
|
||||
console = Console()
|
||||
|
||||
async def demo_basic_usage():
|
||||
"""Demo basic Crawailer usage"""
|
||||
|
||||
console.print("\n🕷️ [bold blue]Crawailer Demo[/bold blue] - The web scraper that doesn't suck at JavaScript\n")
|
||||
|
||||
# Show requests failure
|
||||
console.print("📉 [red]What happens with requests:[/red]")
|
||||
console.print("```python")
|
||||
console.print("import requests")
|
||||
console.print("response = requests.get('https://react-app.example.com')")
|
||||
console.print("print(response.text)")
|
||||
console.print("```")
|
||||
|
||||
# Simulate requests response
|
||||
console.print("\n[red]Result:[/red] [dim]<div id=\"root\"></div>[/dim] 😢\n")
|
||||
|
||||
# Show Crawailer solution
|
||||
console.print("🚀 [green]What happens with Crawailer:[/green]")
|
||||
console.print("```python")
|
||||
console.print("import crawailer as web")
|
||||
console.print("content = await web.get('https://react-app.example.com')")
|
||||
console.print("print(content.markdown)")
|
||||
console.print("```")
|
||||
|
||||
await asyncio.sleep(2)
|
||||
|
||||
# Simulate Crawailer response
|
||||
console.print("\n[green]Result:[/green]")
|
||||
console.print(Panel.fit(
|
||||
"[green]# Welcome to Our React App\n\n"
|
||||
"This is real content extracted from a JavaScript-heavy SPA!\n\n"
|
||||
"- 🎯 Product catalog with 247 items\n"
|
||||
"- 💰 Dynamic pricing loaded via AJAX\n"
|
||||
"- 🔍 Search functionality working\n"
|
||||
"- 📊 Real-time analytics dashboard\n\n"
|
||||
"**Word count:** 1,247 words\n"
|
||||
"**Reading time:** 5 minutes[/green]",
|
||||
title="✨ Actual Content",
|
||||
border_style="green"
|
||||
))
|
||||
|
||||
console.print("\n⚡ [bold]The difference?[/bold] Crawailer executes JavaScript like a real browser!")
|
||||
console.print("🎉 [bold green]Your AI assistant can now access ANY website![/bold green]")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(demo_basic_usage())
|
||||
Loading…
Add table
Add a link
Reference in a new issue