Spaces:
Runtime error
Runtime error
Download docs/examples/hello_world.py from Echo-AI-official/Crawl4AI: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/Echo-AI-official/Crawl4AI/resolve/main/docs/examples/hello_world.py
- Command line
-
hf download hf://spaces/Echo-AI-official/Crawl4AI/docs/examples/hello_world.py
-
curl -L -o hello_world.py https://huggingface.co/spaces/Echo-AI-official/Crawl4AI/resolve/main/docs/examples/hello_world.py
697 Bytes
| import asyncio | |
| from crawl4ai import * | |
| async def main(): | |
| browser_config = BrowserConfig(headless=True, verbose=True) | |
| async with AsyncWebCrawler(config=browser_config) as crawler: | |
| crawler_config = CrawlerRunConfig( | |
| cache_mode=CacheMode.BYPASS, | |
| markdown_generator=DefaultMarkdownGenerator( | |
| content_filter=PruningContentFilter(threshold=0.48, threshold_type="fixed", min_word_threshold=0) | |
| ) | |
| ) | |
| result = await crawler.arun( | |
| url="https://www.helloworld.org", | |
| config=crawler_config | |
| ) | |
| print(result.markdown_v2.raw_markdown[:500]) | |
| if __name__ == "__main__": | |
| asyncio.run(main()) |