TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to wget pages with javascript?

4 pointsby baconfacealmost 14 years ago
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 comments

dsteinalmost 14 years ago
You can write a NodeJS script using the JSDom module to do this.
评论 #2677363 未加载
a3cameroalmost 14 years ago
iMacro? Rhino?
profitbaronalmost 14 years ago
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 未加载
ddemchukalmost 14 years ago
perfect use case for celerity <a href="http://celerity.rubyforge.org/" rel="nofollow">http://celerity.rubyforge.org/</a>