import asyncio from crawl4ai import AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, CacheMode async def main(): browser_conf = BrowserConfig(headless=True) # 设为 False 以观察浏览器 run_conf = CrawlerRunConfig( cache_mode=CacheMode.BYPASS # 此处为获取最新内容,默认为 CacheMode.ENABLED ) async with AsyncWebCrawler(config=browser_conf) as crawler: result = await crawler.arun( url="https://example.com", config=run_conf ) print(result.markdown) if __name__ == "__main__": asyncio.run(main())