乐于分享
好东西不私藏

5条命令让小龙虾学会上网,之前抓不到的文档现在秒开

5条命令让小龙虾学会上网,之前抓不到的文档现在秒开

大家好,我是AI汉堡侠,一个水运工程行业的持证搬砖佬,也是AI浪潮下的赶潮人,热爱一切关于AI的事物,目前专注于AI智能体提效,只分享有用的,拒绝贩卖焦虑,一起拥抱AI时代

今天想写篇关于扣子编程开发网页应用的文章,需要参考扣子官方文档。我让AI去抓取文档内容,结果:

  • web_fetch
     — 被反爬虫拦截
  • browser
     工具 — 提示没有可用浏览器
  • web_search
     — 只能拿到摘要

后面按照小龙虾的提示去查了一下,一查才发现,openclaw browser status显示:

running: false browser: unknown

原来服务器上根本没装Chrome。

精通这篇简单记录一下我配置小龙虾浏览器的全部过程,让小龙虾真正能”上网”。

先介绍的我的配置环境

  • 云服务器
    腾讯云轻量服务器(Lighthouse)
  • 系统
    OpenCloudOS 
  • OpenClaw版本
    2026.3.24
  • Node.js版本
    v22.22.0
  • 龙虾使用的模型(按量计费)
    Kimi 2.5

安装Chrome浏览器

不同Linux发行版,安装包格式不同。

系统
包格式
下载命令
Debian/Ubuntu
.deb
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
OpenCloudOS/CentOS/Fedora
.rpm
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

第一步:下载Chrome安装包

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

⚠️ 踩坑记录:第一次执行时命令换行了,结果报错wget: missing URL。确保命令在一行内执行。

错误示范:

第二步:安装依赖

# 基础字体和工具 
yum install -y liberation-fonts
yum install -y xdg-utils
# 中文字体(防止网页中文显示乱码)
 yum install -y google-noto-sans-cjk-fonts

第三步:安装Chrome

yum localinstall -y ./google-chrome-stable_current_x86_64.rpm

localinstall会自动补齐依赖,比直接用rpm -ivh省心。

验证安装:

which google-chrome 
# 输出:/usr/bin/google-chrome

系统会返回一行路径(通常是 /usr/bin/google-chrome),这个就是安装的路径,记住这个路径下面要用。

配置OpenClaw

安装完Chrome,还需要告诉OpenClaw怎么用它,逐步输入下面命令👇

# 设置使用openclaw模式(隔离环境) 
openclaw config set browser.defaultProfile "openclaw"  
# 开启无桌面模式(服务器必需)
 openclaw config set browser.headless true  
# 强制开启NoSandbox(否则以root用户运行的openclaw,Chrome 出于安全策略拒绝启动
 openclaw config set browser.noSandbox true  
# 指定Chrome路径 
openclaw config set browser.executablePath "/usr/bin/google-chrome"

重启OpenClaw使配置生效:

openclaw gateway restart

启动并验证

启动浏览器服务:

openclaw browser start

看到🦞 browser [openclaw] running: true,说明成功了。

检查状态:

openclaw browser status

输出:

profile: openclaw enabled: true running: true browser: custom executablePath: /usr/bin/google-chrome headless: true noSandbox: true

测试浏览器功能

现在可以让AI使用浏览器了。比如我之前想看扣子官方文档:

 “帮我打开 https://www.coze.cn/open/docs/guides/vibe_coding_web_app,提取关于开发网页应用的核心流程” 

小龙虾现在可以:

  • 打开网页并提取内容
  • 搜索特定信息
  • 截图保存页面
  • 执行页面操作

常见问题汇总

问题
原因
解决
wget:missing URL
命令换行或URL格式错误
确保命令在一行内执行
browser: unknown
未配置Chrome路径
执行openclaw config set browser.executablePath
running: false
Chrome未安装或路径错误
检查which google-chrome
Root权限报错
未开启noSandbox
设置browser.noSandbox true
中文乱码
缺少中文字体
安装google-noto-sans-cjk-fonts

总结

整个过程就三步:

  1. 装Chrome
     — 按系统下载对应包,用yum localinstall安装
  2. 配OpenClaw
     — 设置headless、noSandbox、executablePath
  3. 重启启动
     —gateway restartbrowser start

搞定之后,AI Agent就能真正”上网”了。之前抓不到扣子官方文档的问题也解决了。


今日分享结束。

关于汉堡侠,一个5年国内+3年国外水运工程持证(一级港航)搬砖佬,专注AI工具提效(AI智能体+AI编程),只分享有用的,拒绝贩卖焦虑,一起拥抱AI时代

如需进AI智能体学习沟通群,点个关注并留言