You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 19:28:09