跳到正文
Simon Willison·· 12 小时前AI 评分40

webframe 评测:作为爬虫工具与沙盒环境的实测表现

webframe: evaluated as a scraper and a sandbox

AI 导读

webframe 是 Jeff Lindsay 用 Go 基于系统浏览器开发的工具,可"像运行程序一样运行网页",在隐藏的无头视图中执行页面并将 console.log() 输出到标准输出。

正文 · AI 翻译

研究 webframe:作为爬虫工具和沙箱的评估 — 对 webframe 的评估发现,它是一款快速、轻量的浏览器 JavaScript 运行器,适合用于爬取,性能与 shot-scraper 相当,但存在一些明显的粗糙之处,包括 CSP 失败、0×0 视口、加载挂起、缺少 HTTP 元数据以及有限的浏览器控制能力。

webframe 是 Jeff Lindsay 的一个小巧项目,它可以让你“像运行程序一样运行网页”——你只需指定一个 URL 或文件,它就会在一个隐藏的无头 web 视图中执行该页面,并把 console.log() 输出到标准输出,把异常输出到标准错误。

它使用 Go 编写,构建在 glaze 库之上,该库提供对系统浏览器的访问(“macOS 上是 WKWebView,Linux 上是 WebKitGTK,Windows 上是 WebView2”),因此无需捆绑自己的浏览器引擎。

它让我想起了我自己的 shot-scraper javascript 工具,只是体积小得多,而且不依赖 Playwright。

我让 Claude Opus 5.5 对它进行了全面测试,并为我准备了一份研究报告。以下是我使用的提示词:

Explore https://github.com/tractordev/webframe try running it and put it though its paces, build a few exploratory prototypes, then evaluate it as a potential sandboxing tool and as a tool for scraping web pages using the same patterns encouraged by the "shot-scraper JavaScript" command (see simonw/shot-scraper on GitHub, docs directory)

来源: Simon Willison · simonwillison.net