使用Crawl4ai无法截取网页截图的问题求助
Crawl4ai无法截取网页截图的问题求助
我最近在用Crawl4ai尝试给指定网页截图,但每次尝试要么报错,要么啥结果都没有。我直接照搬了官方文档里的示例代码,具体如下:
import os, asyncio from base64 import b64decode from crawl4ai import AsyncWebCrawler, CacheMode async def main(): async with AsyncWebCrawler() as crawler: result = await crawler.arun( url="https://en.wikipedia.org/wiki/List_of_common_misconceptions", cache_mode=CacheMode.BYPASS, pdf=True, screenshot=True ) if result.success: # Save screenshot if result.screenshot: with open("wikipedia_screenshot.png", "wb") as f: f.write(b64decode(result.screenshot)) # Save PDF if result.pdf: with open("wikipedia_page.pdf", "wb") as f: f.write(result.pdf) print("[OK] PDF & screenshot captured.") else: print("[ERROR]", result.error_message) if __name__ == "__main__": asyncio.run(main())
可运行后却弹出了这样的错误提示:
Error: crawl4ai.async_webcrawler.AsyncWebCrawler.aprocess_html() got multiple values for keyword argument 'screenshot'
有没有大佬能帮忙分析下这问题出在哪呀?
备注:内容来源于stack exchange,提问作者Bernardo
相关产品推荐
相关产品推荐

