Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wget js redirection

When I was using wget I came to the page witch using JS redirections. Something like this:

<script language="JavaScript1.2">
var s = "i_08/0101/index.php3";
location.href=""+s;
</script>

Could wget follow this redirection or is there any other method to solve this.

like image 873
ghi Avatar asked Jun 12 '11 18:06

ghi


2 Answers

You can check the DHTMLGET tool that was built for FAE. The goal of this project is to provide basic inline js and onload events on top of a modified wget:

The dhtmlget utility is to create local copies of websites similar to WGET utility in unix. It supports http, https protocols, as well as retrieval through http proxies.The main difference of DHTMLGET and WGET is the dhtmlget ExecuteS onload and inline javascript. It was developed for use in the Illinois Functional Accessibility Evaluator to analyze websites that use javascrpt to generate content for accessibility features.

A simple Google search can lead you to an interesting page about wget js feature request.

like image 108
regilero Avatar answered Oct 11 '22 01:10

regilero


No.

wget is used for downloading the remote location as-is and does not act as a web browser, which parses the contained JavaScript.

Note that wget does follow header redirects (such as 301, for example).

I tried using lynx -source but sadly, this will result in a non-parsed web page as well. An alternative solution to this problem would be to write a script that downloads the page, then parses it and downloads possible references automatically, but I'll leave that up to you.

like image 32
Aron Rotteveel Avatar answered Oct 11 '22 01:10

Aron Rotteveel