Download site with js links

5

1

I'm trying to download an entire site:

http://givatram.org/bank/hug.php?hug=0

Unfortunately, instead of the standard href tag, the page uses javascript functions to generate links:

<tr>
<td><div align="center" dir="rtl">69821</div></td>
<td onclick='go2("69821");' style="text-decoration:none;color:blue;cursor:pointer;word-wrap:nowrap"><div align="right" dir="rtl">  </div></td>
<td style="text-decoration:none;color:blue;cursor:pointer;word-wrap:nowrap"><div align="center" dir="ltr">1</div></td>
</tr>

I've tried wget and downthemall, but they can't handle this kind of linking mechanism.

How do I download an entire site with js links instead of href tags?

Adam Matan

Posted 2013-06-10T07:12:35.327

Reputation: 5 930

I fear there will be no solution available. Those links are homebrewed (somehow pretty evil) and following them would require the downloader to have a JavaScript engine which runs the code and checks for window.location = or any other means of redirection. I doubt that such a program exists (especially that parsing JavaScript part). – Bobby – 2013-06-10T11:18:24.723

Related question about JS links: How to open stubborn javascript links in a new tab or new window?

– Karan – 2013-06-10T17:50:13.350

I'm also looking for a way to get wget to follow "javascript links". But it doesn't have to be as complicated as having a javascript engine! Is it possible to apply custom transformations to the downloaded html files, for instance "javascript='open(343)'" → "article.php?id=343" ? – Manu – 2014-05-18T10:17:16.260

No answers