Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-08-2008, 07:16 PM   #1
Registered: Jun 2008
Posts: 47

Rep: Reputation: Disabled
Unhappy problem with wget

Hello everyone!
I'm somewhat new to linux, so please bear with me

I'm using Ubuntu 8.04, and I'm currently trying enlightenment 17, which has the most wonderful slideshow desktop gadget; it basically shows on the desktop the pictures you put on a given directory. After growing tired of my local images, I thought it'd be great if I could just make it fetch images from the web... So, after doing my homework on wget, grep, and awk, I'm currently trying to write a shell script that downloads some new images to the gadget directory everyday. The problem is, my wget is just not working as I would expect it to (prolly my fault here but... :P)

For example:
If I do a "wget -r -l2 -A jpg [h t t p : / /]google[dot]com", it doesn't download anything (I can't post links yet... it should download *at least* the logo jpg, right?)
A simple "wget -r -l2 [h t t p : / /]google[dot]com" just gives me the index.html file

At first I thought there was something wrong with my wget, but I've built it from source, and nothing changed...

Am I missing something?
Thank you!

Last edited by goncalopp; 06-08-2008 at 07:17 PM.
Old 06-08-2008, 07:35 PM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Well first, it would seem that the images are .png not .jpg, so that would be an issue (have a look at the source code for the page)

Second, I'm pretty sure you can set web servers to stop downloading of images referenced from html code, and since the google code seems to pull images from a separate directory, there's a pretty good chance they've done this.

In any case, the images aren't in the root of, so I guess it makes sense that it can't find them there

Try your code on a site you know has jpgs in it first to check it's correctness

Last edited by billymayday; 06-08-2008 at 07:41 PM.
Old 06-08-2008, 08:03 PM   #3
Registered: Jun 2008
Posts: 47

Original Poster
Rep: Reputation: Disabled
You're right, google is indeed a bad example...
I'm currently trying
It has at least one jpg:
<img src="" alt=""
but, "wget -nd -r -l1 -A jpg" only returns "robots.txt"... Which it shouldn't I have no idea what's going on...
I've also tried "-U Mozilla", with no luck

ok, it seems I was missing "-p", to download all files referenced by the html page.
I'm now trying with, which as plenty of jpgs, and I'm using
wget -nd -r -l2 -p -U Mozilla
which gives me just index.html...?

Last edited by goncalopp; 06-08-2008 at 08:26 PM.
Old 06-08-2008, 08:46 PM   #4
Registered: Jun 2008
Posts: 47

Original Poster
Rep: Reputation: Disabled
Solved it!
It seems by default wget doesn't download files from other hosts...
A simple "--span-hosts" did the trick!
Thanks for your help



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
wget problem Captain Civic Linux - Newbie 2 04-09-2008 09:07 PM
Wget problem theoldnyx Linux - Software 2 03-08-2008 07:29 AM
wget problem spx2 Linux - General 7 08-17-2006 06:25 AM
problem using wget, please help squirrel001 Linux - Networking 8 03-01-2006 08:01 AM
problem wiht wget true_atlantis Linux - Software 5 01-13-2004 08:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:46 AM.

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