跳到正文
Simon Willison·· 10 小时前AI 评分34

webframe 评测:作为抓取工具与沙箱表现如何

webframe: evaluated as a scraper and a sandbox

AI 导读

对 Jeff Lindsay 的 webframe 评测显示,这个基于 Go 和 glaze 库的轻量浏览器 JavaScript 运行器抓取性能与 shot-scraper 相当,且不依赖 Playwright。但它存在 CSP 失败、0×0 视口、加载挂起、缺失 HTTP 元数据和浏览器控制有限等明显问题。

正文 · 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