Files
python/python爬虫/crawl4ai/01_案例.py
T
2025-08-05 09:19:34 +08:00

8 lines
288 B
Python

import asyncio
from crawl4ai import AsyncWebCrawler
async def main():
async with AsyncWebCrawler() as crawler:
result = await crawler.arun("https://example.com")
print(result.markdown[:300]) # 打印前 300 个字符
if __name__ == "__main__":
asyncio.run(main())