# Wget won't do it (solved)

## Bigun

 *http://www.gnu.org/software/wget/faq.html#3.6 wrote:*   

> 
> 
>  3.6 Does Wget understand JavaScript?
> 
> Wget doesn't feature JavaScript support and is not capable of performing recursive retrieval of URLs included in JavaScript code.
> ...

 

At any rate, that's exactly what I need.  A command-line interface for downloading that can process javascript redirects.  The only thing I saw come even close was Links, but I saw no option for downloading, then exiting.  Suggestions?

----------

## embobo

I'd be a bit of work but you might use SpiderMonkey for this:

http://www.mozilla.org/js/spidermonkey/

Rather than C I'd use the perl interface:

http://search.cpan.org/~tbusch/JavaScript-SpiderMonkey/

Otherwise, if you know what the url would look like I'd try to write a hack to grep it out of the javascript and then wget that.

----------

## desultory

If you are going to use Perl, CPAN should have most of what you are looking for: 

http://search.cpan.org/search?query=javascript&mode=all, http://search.cpan.org/search?query=LWP&mode=all.

Using g-cpan (app-portage/g-cpan) allows CPAN packages to be managed via Portage, after it converts them.

----------

