跳到正文
Simon Willison·· 28 天前精选AI 评分32

webframe:作为网页抓取工具和沙箱的评估

webframe: evaluated as a scraper and a sandbox

AI 导读

Simon Willison 评估了 Jeff Lindsay 开发的 webframe,认为它是快速、轻量的浏览器 JavaScript 执行器,适合网页抓取,性能与 shot-scraper 相当。评估也发现 CSP 失败、视口为 0×0、页面加载挂起、缺少 HTTP 元数据及浏览器控制有限等问题。

正文 · AI 翻译

研究 webframe:作为爬虫和沙箱进行评估 — 对 webframe 的评估发现,它是一款快速、轻量级的浏览器 JavaScript 运行器,适合网页抓取,性能可与 shot-scraper 媲美,但也存在一些明显问题,包括 CSP 失败、视口大小为 0×0、加载卡住、缺少 HTTP 元数据,以及浏览器控制功能有限。

webframe 是 Jeff Lindsay 的一个有意思的小项目,让你可以“像运行程序一样运行网页”——你给它一个 URL 或文件,它就会在隐藏的无头网页视图中执行,并将 console.log() 输出到标准输出,将任何异常输出到标准错误。

它基于 glaze 库用 Go 编写,可访问系统浏览器(“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