[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] URL rewriting when resource name is in a variable
From: |
Murali Ramanujam |
Subject: |
Re: [Bug-wget] URL rewriting when resource name is in a variable |
Date: |
Tue, 18 Aug 2015 09:50:10 +0800 |
Hi
Sorry for the initial confusion.
I have the following script tag in the original web page.
<script>
var loc = "script.js";
document.write("<script src=" + loc + "><\/script>");
</script>
When I save it using wget -k -p, the corresponding saved file has the
following script tag
<script>
var loc = "script.js";
document.write("<script src="http://localhost/+ loc +"><\/script>");
</script>
The script tag written by document.write is expected to be “script.js” but
wget saves it as “http://localhost/+loc+”
Wget is trying to rewrite the link for scripts written by document.write
which is not supposed to happen.
Thanks
Regards,
Murali
On Mon, Aug 17, 2015 at 10:16 PM, Ander Juaristi <address@hidden> wrote:
> On 08/17/2015 05:04 AM, Murali Ramanujam wrote:
>
>> Hi
>>
>>
>> When I try to save the attached HTML page (original.html) with wget -k
>> -p, the resource path gets mangled in the rewrite process (saved.html is
>> output of wget).
>>
>>
> If I understood you well, you execute
>
> wget -k -p http://localhost/original.html
>
> and get a file called 'saved.html' as a result?!
>
> What do you mean with "resource name is in a variable"? What's the exact
> command you executed on the console?
>
>
>> The saved page gives a SyntaxError error when opened. In addition, it
>> looks like wget is trying to rewrite the src to http://localhost/loc but
>> it should be http://localhost/script.js.
>>
>>
>> Script.js is just console.log(1);
>>
>>
>> Is this a valid bug? Is there any way to get expected behaviour from wget
>> in such a situation?
>>
>>
>>
> Could you pass the flag '--debug' and post the output?
>
>
>>
>> Thanks
>> Murali
>>
>>
>
> Regards,
> - AJ
>