Is it possible to essentially run a wget
from within a node.js app? I'd like to have a script that crawls a site, and downloads a specific file, but the href
of the link that goes the file changes fairly often. So, I figured the easiest way to go about doing it would be to find the href
of the link, then just perform a wget on it.
Thanks!
For future reference though, I would recommend request, which makes it this easy to fetch that file:
U can just use wget.
While it might be a little more verbose than some third-party stuff, Node's core
HTTP
module provides for an HTTP client you could use for this:You can use node-wget. Works in cases where 'wget' is not possible
You can run an external command using child_processes:
http://nodejs.org/docs/latest/api/child_process.html#child_process_child_process_exec_command_options_callback