For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/ai/agent-lynx/screenshots.md.
AI logo
AI
  • 简体中文
  • 截图

    截图前先连接应用,并选择目标 session。

    标注截图与全屏截图

    agent-lynx screenshot --annotate -o ./page.jpeg

    该命令截图并刷新快照。图片中的 [3] 等标记对应 @e3 等元素引用,agent 可以据此识别并操作可见目标。添加 --json 后,可获得截图路径、尺寸和同一次调用生成的新快照,便于程序读取。

    下面的示意图来自在 Lynx Explorer 中运行的 Tailwind CSS 示例。悬停、点击或用键盘聚焦任一连线目标,即可同时高亮截图中的标注框和 snapshot 中的引用。

    需要全屏截图时,使用 agent-lynx screenshot --fullscreen -o ./screen.jpeg。--annotate 和 --fullscreen 应分别使用。

    直接截图与完整滚动内容

    agent-lynx take-screenshot --fullscreen -o ./screen.jpeg
    agent-lynx take-content-screenshot --selector '#feed' --format png --scale 1 -o ./feed.png

    take-content-screenshot 获取第一个匹配滚动容器的完整内容,包括可见区域外的部分。目标应为 scroll-view 或兼容的 list,且运行时需要支持该元素的内容截图 UI 方法。需要元素引用标记时,使用 screenshot --annotate。

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。