文章目录
资料来源:https://my.feishu.cn/wiki/LuRMwMOYviKhVHkaTq7cpdx3nEN
-
下载
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
-
下载好后执行安装
sudo dpkg -i google-chrome-stable_current_amd64.deb
-
依赖补齐
sudo apt-get install -f
-
查看
which google-chrome-stable
google-chrome-stable --version -
验证下无沙箱、无头模式下的 CDP 连接
google-chrome-stable --no-sandbox --headless --remote-debugging-port=9222
-
配置openclaw
openclaw config set browser.enabled true --json
// 启用浏览器能力 - 一般默认就是启用的openclaw config set browser.executablePath "/usr/bin/google-chrome-stable"
// 置顶一下浏览器程序路径,就是我们上面 which 命令输出的 Chrome 的实际可执行文件路径openclaw config set browser.headless true --json
// 开启 headless 模式即无头模式,也就是没有图形界面窗口。openclaw config set browser.noSandbox true --json
// 关闭沙箱,规避 Linux 类服务器/容器环境下的权限与隔离限制问题openclaw config set browser.defaultProfile "openclaw"
// 指定默认浏览器 profile,让 OpenClaw 默认使用名为 openclaw 的浏览器配置文件。 -
重启
openclaw gateway restart
-
启动实例
openclaw browser --browser-profile openclaw start
打开网页
openclaw browser --browser-profile openclaw open <https://amux.ai>
// 让启动的浏览器打开一个示例网站的标签页
再来抓一个页面快照或者直接截图也行:
openclaw browser --browser-profile openclaw snapshot
// 截取当前页面的结构化快照
// or
openclaw browser --browser-profile openclaw screenshot
// 对当前页面截图