bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] How to set -l to be zero? (Or how to download a single we


From: Micah Cowan
Subject: Re: [Bug-wget] How to set -l to be zero? (Or how to download a single webpage and convert the absolute links to relative links with wget?)
Date: Wed, 02 Jun 2010 13:09:12 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4

On 06/02/2010 12:53 PM, Peng Yu wrote:
> On Tue, Jun 1, 2010 at 10:40 PM, Micah Cowan <address@hidden> wrote:
>> On 06/01/2010 05:53 PM, Peng Yu wrote:
>>> On Tue, Jun 1, 2010 at 6:48 PM, Micah Cowan <address@hidden> wrote:
>>>> On 06/01/2010 04:36 PM, Peng Yu wrote:
>>>>> I need to use the option --convert-links to download only one webpage,
>>>>> because I want to convert absolute links to relative links if the
>>>>> links are under the host directory where the webpage is in. Since I
>>>>> only interest in one page, I'd like to set -l be zero. But it seems
>>>>> that if I set it to zero, wget will download everything linked from
>>>>> this webpage.
>>>>
>>>> The way to say "I don't want to download recursively" isn't -r -l 0,
>>>> it's to leave out -r altogether.
>>>
>>> It seems that --convert-links only works if -r is specified, right? If
>>> I want to use --convert-links, then I have to specify -r?
>>
>> Works for me without -r, at least in version 1.12.
> 
> No. It doesn't work for me. I tried on both version 1.10 and 1.12.
> None of them works for me.
> 
> Suppose I download the webpage at
> 
> http://xxx.com/yyy/zzz.html
> 
> , which has the following code <a
> href="http://xxx.com/yyy/uuu/www.html> some </a>
> 
> The above link will not be converted automatically to <a
> href="uuu/www.html> some </a>, if I only have --convert-links but no
> other options.

Ah, sorry, I misunderstood what you wanted. What I described will
convert relative links to absolute links, not vice versa.

You're right, to get what you want, then you need recursion; wget only
converts links to point at pages locally, if it directly knows they've
been downloaded (because it had done so). That being the case, -l 0
wouldn't have worked even if it did what you hoped, because it would not
have downloaded them, so there's no way to do it without recursing to
the links that you want to be converted afterward.

-- 
Micah J. Cowan
http://micah.cowan.name/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]