LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2007, 05:09 AM   #1
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Rep: Reputation: 15
Smile Use wget got wrong file.


Dear all:

I used wget to dowload file from http://195.235.160.80/index.wml(actually I want to download index.wml and all other related files), but I got index.html and it's related files.

I used
#wget -rc 195.235.160.80

Who can tell me how can I get index.wml and all other related files?

Thanks,
 
Old 03-30-2007, 05:49 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
type the url correctly? it works just fine for me.
 
Old 03-30-2007, 05:52 AM   #3
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thanks budy,

Yes, it's the right URL which I repeat as http://195.235.160.80/index.wml
 
Old 03-30-2007, 05:54 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
yes, that's the right url.... here's the proof...

Code:
[user@server /]# curl http://195.235.160.80/index.wml
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>

<card title="TME Test Server">

<p>
TME test index:<br/>
etc...
it works.
 
Old 03-30-2007, 06:14 AM   #5
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
I paste the correct and wrong result picture, pls see. Sorry, I can't attach the picture for not finding the attaching button.

In my side, after executed following:
#wget -rc 195.235.160.80

I got index.html, manual(folder)and icons(folder) in "195.235.160.80"(also folder).

No index.wml and related files at all.

Thanks,
 
Old 03-30-2007, 06:54 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you expect to get "http://195.235.160.80/index.wml" by requesting "http://195.235.160.80" ??? you aren't even using the right url that you're saying isnt' working...
 
Old 03-31-2007, 01:50 AM   #7
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thanks for your reply.

However, maybe I didn't speak out my purpose clearly.

What my intent is to download all related file of "index.wml" from "http://195.235.160.80/index.wml", and after downloading you can open a test page via OPERA(by choosing index.wml)locally. And then you can choose other links in the wml page&go to the right pages.

Yes, you can even download "index.wml" from "http://195.235.160.80/index.wml", but you can't download the other relate files automaticly. If you use OPERA to open "index.wml", yes, you can open this page. Then if you choose other links from this page, you will not get the right result as above.

Note: OPERA is a kind of browser, you can get free from http://www.opera.com/download/windows/

Thank you once again.
 
Old 03-31-2007, 02:33 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
well that really has nothing to do with what you were originally asking does it? so use the wget command that *does* work and put the -r on it there.


and i doubt there's anyone around here who's not been aware of Opera for a long long time.
 
Old 03-31-2007, 02:44 AM   #9
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thanks, man.

But I have already use "-r" as below:

#wget -rc 195.235.160.80
 
Old 03-31-2007, 02:47 AM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
yes but you're not trying to download the right file there are you??? ugh...
 
Old 03-31-2007, 03:44 AM   #11
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thanks for your fast reply.

I tried
#wget -rc 195.235.160.80
then I got index.html and icons(folder) and manual(folder)

I tried
#wget -rc http://195.235.160.80/index.wml
then I got index.wml only
and I also need other related file(folders)
 
Old 03-31-2007, 04:33 AM   #12
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Clarity time. Are you trying to download the whole site to your PC? Because "I also need other related file(folders)" tells us nothing about what you are trying to do. Do you need all files ending in .xml or beginning with index. ?

If you are trying to download the whole site, look at the man page for wget and read the entry on mirroring.
 
Old 04-02-2007, 05:58 AM   #13
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thanks for reply.

Yes, I do need to download the whole page.

After learn the man page,
I tried
#wget -r -c 195.235.160.80
I got only index.html and its related files

I tried
# wget -r -c -i http://195.235.160.80/
http://195.235.160.80/: No such file or directory
No URLs found in http://195.235.160.80/.

FINISHED --06:59:19--
Downloaded: 0 bytes in 0 files

I tried
#wget -r -c -E 195.235.160.80
This time I still got only index.html and its related files

It really puzzled me. Could anybody please help me out?

Thanks,
 
Old 04-02-2007, 11:27 AM   #14
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
A few tips:
1) -c is only for continuing a previously interrupted download. So you don't need it at this point.
2) -i is for specifying a local file (ie HTML file) in which you have specified URLs (addresses) to download from. As you want to download from just one place, you don't need this either.

3) "wget -r -c 195.235.160.80" doesn't cut it. You need to add the "/index.wml" part to it, otherwise wget will look for a file called index.html (or similar) by default.

4) WML is a form of XML, not HTML (expected by wget). So you might want to use --folow-tags to specify a list of tags to follow. Luckily though, the anchor tag (<a href=...>) is the same in WML as it is in XML, so you might get away with that anyway.

5) -p option to download all related inline images, video, ... (instead of just the related html/wml/xml pages)
6) -m (mirroring) might help too.
7) -k (converting links so that they can be viewed locally) seems ideally suited for your goal.
8) Please read the man page THOROUGHLY. And please listen to other people's advice carefully, rather than insisting on doing the same commands over and over again.
 
Old 04-03-2007, 03:40 AM   #15
brave heart
Member
 
Registered: Mar 2007
Distribution: Fedora-14
Posts: 155
Blog Entries: 8

Original Poster
Rep: Reputation: 15
Thank you, timmeke and other guys. You guys are really warm heart and not so strict to let us ask questions.

Forgive me for not understanding the man page well. I'm really a newbie and not a native English speaker. And this problem really driven me crazy in this several days.

After learn the man page&you guy's answer more carefully,
I tried as following:
# wget -p -m -k --follow-tags='*.wml' http://195.235.160.80/index.wml
--05:46:46-- http://195.235.160.80/index.wml
=> `195.235.160.80/index.wml'
Connecting to 195.235.160.80:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,294 [text/vnd.wap.wml]

100%[=================================================================================>] 1,294 1.23M/s ETA 00:00

05:46:49 (1.23 MB/s) - `195.235.160.80/index.wml' saved [1294/1294]


FINISHED --05:46:49--
Downloaded: 1,294 bytes in 1 files
Converted 0 files in 0.00 seconds.

Only "index.wml" be downloaded. I still can't down the whole page!!!

Gosh!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to download file using wget linuxnewbie82 Programming 6 02-14-2007 05:48 AM
how to specify the name of the wget output file datasink Linux - Networking 2 01-23-2007 08:39 PM
wGet is there a command for file size? SonoranFun Linux - Software 2 01-02-2006 04:56 PM
where does konqueror and wget downloaded file go eatmars Linux - Software 2 08-28-2005 11:11 PM
wget any version of a file? shishimo Linux - General 1 07-08-2004 02:37 PM


All times are GMT -5. The time now is 05:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration