FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Red Hat Linux

 
 
LinkBack Thread Tools
 
Old 11-09-2008, 07:11 PM
Yong Huang
 
Default OT: wget does not use downloaded stylesheet

Excuse me for this off-topic message, but I think Linux users can help me. I use "wget -r -p http://somewebsite" to try to download everything to my laptop. The intent is to view the pages even if I'm offline. -r for recursive and -p for page requisite. The stylesheets and all images are correctly downloaded. But the HTML code is not changed to use the downloaded stylesheet. For example (I only changed the real domain to example.com):

<link rel="stylesheet" type="text/css" href="http://example.com/.design.css" media="screen"><style>html {background-image:url('http://example.com/Backgrounds/Floral/natfl176.jpg');background-repeat:repeat;background-position:top left;}</style>
<link rel="stylesheet" type="text/css" href="http://example.com/Members/Generationz/Standard/PrintCSS/print.css" media="print">

So if my laptop is offline, the page is not rendered correctly. I can't think of an easy way to correct this except by manually modifying the stylesheet URL. Any advice?

Yong Huang




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-09-2008, 07:35 PM
 
Default OT: wget does not use downloaded stylesheet

Try -mr


Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Yong Huang <yong321@yahoo.com>

Date: Sun, 9 Nov 2008 12:11:16
To: <redhat-list@redhat.com>
Subject: OT: wget does not use downloaded stylesheet


Excuse me for this off-topic message, but I think Linux users can help me. I use "wget -r -p http://somewebsite" to try to download everything to my laptop. The intent is to view the pages even if I'm offline. -r for recursive and -p for page requisite. The stylesheets and all images are correctly downloaded. But the HTML code is not changed to use the downloaded stylesheet. For example (I only changed the real domain to example.com):

<link rel="stylesheet" type="text/css" href="http://example.com/.design.css" media="screen"><style>html {background-image:url('http://example.com/Backgrounds/Floral/natfl176.jpg');background-repeat:repeat;background-position:top left;}</style>
<link rel="stylesheet" type="text/css" href="http://example.com/Members/Generationz/Standard/PrintCSS/print.css" media="print">

So if my laptop is offline, the page is not rendered correctly. I can't think of an easy way to correct this except by manually modifying the stylesheet URL. Any advice?

Yong Huang




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-10-2008, 04:34 PM
Yong Huang
 
Default OT: wget does not use downloaded stylesheet

Thanks, Chaim. But that doesn't work either. I created a minimalist test case:

http://yong321.freeshell.org/temp/test.html

I ran wget -mr http://yong321.freeshell.org/temp/test.html and check the downloaded test.html file. It still has

<link rel="stylesheet" type="text/css" href="http://yong321.freeshell.org/temp/stylesheettest.css">

I don't think wget could be smart enough to modify the URL inside the html file.

Yong Huang


--- On Sun, 11/9/08, chaim.rieger@gmail.com <chaim.rieger@gmail.com> wrote:

> From: chaim.rieger@gmail.com <chaim.rieger@gmail.com>
> Subject: Re: OT: wget does not use downloaded stylesheet
> To: yong321@yahoo.com, "General Red Hat Linux discussion list" <redhat-list@redhat.com>
> Date: Sunday, November 9, 2008, 2:35 PM
>
> Try -mr
>
>
> Sent via BlackBerry from T-Mobile
>
> -----Original Message-----
> From: Yong Huang <yong321@yahoo.com>
>
> Date: Sun, 9 Nov 2008 12:11:16
> To: <redhat-list@redhat.com>
> Subject: OT: wget does not use downloaded stylesheet
>
>
> Excuse me for this off-topic message, but I think Linux
> users can help me. I use "wget -r -p
> http://somewebsite" to try to download everything to my
> laptop. The intent is to view the pages even if I'm
> offline. -r for recursive and -p for page requisite. The
> stylesheets and all images are correctly downloaded. But the
> HTML code is not changed to use the downloaded stylesheet.
> For example (I only changed the real domain to
> example.com):
>
> <link rel="stylesheet"
> type="text/css"
> href="http://example.com/.design.css"
> media="screen"><style>html
> {background-image:url('http://example.com/Backgrounds/Floral/natfl176.jpg');background-repeat:repeat;background-position:top
> left;}</style>
> <link rel="stylesheet"
> type="text/css"
> href="http://example.com/Members/Generationz/Standard/PrintCSS/print.css"
> media="print">
>
> So if my laptop is offline, the page is not rendered
> correctly. I can't think of an easy way to correct this
> except by manually modifying the stylesheet URL. Any
> advice?
>
> Yong Huang
>
>
>
>
> --
> redhat-list mailing list
> unsubscribe
> mailto:redhat-list-request@redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-10-2008, 08:01 PM
Dag Wieers
 
Default OT: wget does not use downloaded stylesheet

On Mon, 10 Nov 2008, Yong Huang wrote:


Thanks, Chaim. But that doesn't work either. I created a minimalist test case:

http://yong321.freeshell.org/temp/test.html

I ran wget -mr http://yong321.freeshell.org/temp/test.html and check the downloaded test.html file. It still has

<link rel="stylesheet" type="text/css" href="http://yong321.freeshell.org/temp/stylesheettest.css">

I don't think wget could be smart enough to modify the URL inside the html file.


You thought wrong. The wget man-page explains it:

-k
--convert-links
After the download is complete, convert the links in the document to
make them suitable for local viewing. This affects not only the visi-
ble hyperlinks, but any part of the document that links to external
content, such as embedded images, links to style sheets, hyperlinks to
non-HTML content, etc.

Each link will be changed in one of the two ways:

* The links to files that have been downloaded by Wget will be
changed to refer to the file they point to as a relative link.

Example: if the downloaded file /foo/doc.html links to
/bar/img.gif, also downloaded, then the link in doc.html will be
modified to point to ../bar/img.gif. This kind of transformation
works reliably for arbitrary combinations of directories.

* The links to files that have not been downloaded by Wget will be
changed to include host name and absolute path of the location
they point to.

Example: if the downloaded file /foo/doc.html links to
/bar/img.gif (or to ../bar/img.gif), then the link in doc.html
will be modified to point to http://hostname/bar/img.gif.

Because of this, local browsing works reliably: if a linked file was
downloaded, the link will refer to its local name; if it was not down-
loaded, the link will refer to its full Internet address rather than
presenting a broken link. The fact that the former links are con-
verted to relative links ensures that you can move the downloaded
hierarchy to another directory.

Note that only at the end of the download can Wget know which links
have been downloaded. Because of that, the work done by -k will be
performed at the end of all the downloads.

There are some other options that might interest you.

Kind regards,
--
-- dag wieers, dag@wieers.com, http://dag.wieers.com/ --
[Any errors in spelling, tact or fact are transmission errors]

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 
Old 11-10-2008, 08:51 PM
Yong Huang
 
Default OT: wget does not use downloaded stylesheet

--- On Mon, 11/10/08, Dag Wieers <dag@wieers.com> wrote:

> From: Dag Wieers <dag@wieers.com>
> Subject: Re: OT: wget does not use downloaded stylesheet
> To: yong321@yahoo.com, "General Red Hat Linux discussion list" <redhat-list@redhat.com>
> Cc: chaim.rieger@gmail.com
> Date: Monday, November 10, 2008, 3:01 PM
> On Mon, 10 Nov 2008, Yong Huang wrote:
>
> > Thanks, Chaim. But that doesn't work either. I
> created a minimalist test case:
> >
> > http://yong321.freeshell.org/temp/test.html
> >
> > I ran wget -mr
> http://yong321.freeshell.org/temp/test.html and check the
> downloaded test.html file. It still has
> >
> > <link rel="stylesheet"
> type="text/css"
> href="http://yong321.freeshell.org/temp/stylesheettest.css">
> >
> > I don't think wget could be smart enough to modify
> the URL inside the html file.
>
> You thought wrong. The wget man-page explains it:
>
> -k
> --convert-links
> After the download is complete, convert the
> links in the document to
> make them suitable for local viewing. This
> affects not only the visi-
> ble hyperlinks, but any part of the document
> that links to external
> content, such as embedded images, links to
> style sheets, hyperlinks to
> non-HTML content, etc.
>
> Each link will be changed in one of the two
> ways:
>
> * The links to files that have been
> downloaded by Wget will be
> changed to refer to the file they point to
> as a relative link.
>
> Example: if the downloaded file
> /foo/doc.html links to
> /bar/img.gif, also downloaded, then the
> link in doc.html will be
> modified to point to ../bar/img.gif. This
> kind of transformation
> works reliably for arbitrary combinations
> of directories.
>
> * The links to files that have not been
> downloaded by Wget will be
> changed to include host name and absolute
> path of the location
> they point to.
>
> Example: if the downloaded file
> /foo/doc.html links to
> /bar/img.gif (or to ../bar/img.gif), then
> the link in doc.html
> will be modified to point to
> http://hostname/bar/img.gif.
>
> Because of this, local browsing works reliably:
> if a linked file was
> downloaded, the link will refer to its local
> name; if it was not down-
> loaded, the link will refer to its full
> Internet address rather than
> presenting a broken link. The fact that the
> former links are con-
> verted to relative links ensures that you can
> move the downloaded
> hierarchy to another directory.
>
> Note that only at the end of the download can
> Wget know which links
> have been downloaded. Because of that, the
> work done by -k will be
> performed at the end of all the downloads.
>
> There are some other options that might interest you.
>
> Kind regards,
> --
> -- dag wieers, dag@wieers.com, http://dag.wieers.com/

Thanks Dag. -k is exactly what I need.

Yong




--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
 

Thread Tools




All times are GMT. The time now is 01:42 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org