On 2008-12-16 10:08 -0500, Allan Spiegel wrote:
> is there any way to convince wget to follow links in javascript? for
> example I have a lot of links like:
>
> <a
> href="javascript:openPopupWindow('help/login_help.html',520,380)">Help</a>
>
> it would be great if wget could either
>
> - be told to treat anything that looks like a URL inside a href
> parameter as an ordinary link, or
> - be provided with a set of sed scripts to run against javascript that
> spit out links
Wget should have a way to filter all href= and/or src= through an
arbitrary command. That would solve in one go two classes of
problems :
- with commands like grep, that of specifying what links are to be
followed in a more flexible way than -A, -R, -np and friends,
- with commands like awk and sed, that of rewriting links (like
you are proposing).
The cost would be one fork/exec per page. IMHO quite acceptable in
regard of the very high power/development-time ratio.
--
André Majorel <URL:http://www.teaser.fr/~amajorel/>