TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to wget pages with javascript?

4 点作者 baconface将近 14 年前
I need to wget a url, allow the javascript to execute, and capture the result in a file. I've tried wget, curl, httrack,plugins like lget, and links(2) and none of them execute JS.<p>I want something like $: firefox &#60;url&#62; -s &#60;file&#62;<p>Does anyone know how to accomplish this behavior without using JS?

4 条评论

dstein将近 14 年前
You can write a NodeJS script using the JSDom module to do this.
评论 #2677363 未加载
a3camero将近 14 年前
iMacro? Rhino?
profitbaron将近 14 年前
Personally, I'd use <a href="http://www.phantomjs.org/" rel="nofollow">http://www.phantomjs.org/</a> and create a script which loads the page like a browser. Once you've done that you can get it to take screenshot or use JS to pull data off the page.
评论 #2677054 未加载
ddemchuk将近 14 年前
perfect use case for celerity <a href="http://celerity.rubyforge.org/" rel="nofollow">http://celerity.rubyforge.org/</a>