Specific image to be downloaded with wget


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Specific image to be downloaded with wget
# 1  
Old 10-19-2012
Specific image to be downloaded with wget

Hello All,

I have gone through Google and came to know that we can download images from a site using wget.

Now I am been asked to check whether an image is populated in a site or not. If yes, please send that image to an address as an attachment..

Say for example, the site is Wiki - Wikipedia, the free encyclopedia
and image to be downloaded is 220px-Ward_Cunningham_-_Commons-1.jpg

but when I use the below command, this retrieves all the images in the site and its sublinks.

Code:
wget -r -A jpeg,jpg http://en.wikipedia.org/wiki/Wiki

It creates a directory from where i run, and keeps all the contents in a hierarchy manner.

How can I download only the image 220px-Ward_Cunningham_-_Commons-1.jpg and not anything in my system, not even the source html.

Awaiting for your response thanks.
# 2  
Old 10-19-2012
Why don't you give wget the exact and complete URL of that image?
# 3  
Old 10-19-2012
This is what I found out from the source. In this case, the href links to the jpg, but in my real time work, href links to the Site and not to the image.


<div class="thumbinner" style="width:222px;"><a href="/wiki/File:Ward_Cunningham_-_Commons-1.jpg" class="image"><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/8/88/Ward_Cunningham_-_Commons-1.jpg/220px-Ward_Cunningham_-_Commons-1.jpg" width="220" height="236" class="thumbimage" /></a>
# 4  
Old 10-19-2012
Quote:
Originally Posted by sathyaonnuix
T
<div class="thumbinner" style="width:222px;"><a href="/wiki/File:Ward_Cunningham_-_Commons-1.jpg" class="image"><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/8/88/Ward_Cunningham_-_Commons-1.jpg/220px-Ward_Cunningham_-_Commons-1.jpg" width="220" height="236" class="thumbimage" /></a>

Append http://en.wikipedia.org and then use wget.

like

Code:
wget http://en.wikipedia.org/wiki/File:Ward_Cunningham_-_Commons-1.jpg

This User Gave Thanks to pamu For This Post:
# 5  
Old 10-19-2012
thanks Pamu, it works Smilie
# 6  
Old 10-19-2012
Why don't you use the
Quote:
src="//upload.wikimedia.org/wikipedia/commons/thumb/8/88/Ward_Cunningham_-_Commons-1.jpg/220px-Ward_Cunningham_-_Commons-1.jpg"
---------- Post updated at 09:51 AM ---------- Previous update was at 09:44 AM ----------

Quote:
Originally Posted by sathyaonnuix
thanks Pamu, it works Smilie
Does it? If I use pamu's wget cmd, I get an HTML file. Issueing wget with the contents of the src tag, I get an image.
# 7  
Old 10-19-2012
@RudiC: Yes , it works.

I have appended my website address followed by the Image location.

http://en.wikipedia.org//upload.wiki..._Commons-1.jpg

I have not tried the code given by Pamu, I tried his concept of appending the site address before the img src.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

2. Shell Programming and Scripting

BASH scripting - Preventing wget messed downloaded files

hello. How can I detect within script, that the downloaded file had not a correct size. linux:~ # wget --limit-rate=20k --ignore-length -O /Software_Downloaded/MULTIMEDIA_ADDON/skype-4.1.0.20-suse.i586.rpm ... (6 Replies)
Discussion started by: jcdole
6 Replies

3. Solaris

Creating soalris 9 ISO image with use of downloaded OS

Hi Folks, I have downloaded OS on one of my server and i want to create bootable solaris 9 ISO image with use of this...I need to use this image to other server.,Could you please let us know how we will create ISO image with below OS image.. # cd solaris_9 # ls -alrt total 128 drwxr-xr-x ... (3 Replies)
Discussion started by: susindram
3 Replies

4. Shell Programming and Scripting

matching image files to create one image

Hi, I have two sets of image files. Both sets have names A to Z but set 1 ends with .cdt.png and set 2 ends with .matrix.png. I want set 1 to match with set 2 if the names match (i.e. A.cdt.png will match with A.matrix.png) and with the convert image tool (program for images), it will merge the... (6 Replies)
Discussion started by: kylle345
6 Replies

5. Shell Programming and Scripting

Extract urls from index.html downloaded using wget

Hi, I need to basically get a list of all the tarballs located at uri I am currently doing a wget on urito get the index.html page Now this index page contains the list of uris that I want to use in my bash script. can someone please guide me ,. I am new to Linux and shell scripting. ... (5 Replies)
Discussion started by: mnanavati
5 Replies

6. Shell Programming and Scripting

Help with WGET and renaming downloaded files :(

Hi everybody, I would greatly appreciate some expertise in this matter. I am trying find an efficient way to batch download files from a website and rename each file with the url it originated from (from the CLI). (ie. Instead of xyz.zip, the output file would be http://www.abc.com/xyz.zip) A... (10 Replies)
Discussion started by: o0110o
10 Replies

7. Shell Programming and Scripting

how to limit files downloaded by wget

I am trying to download a page and retrieve only wav and mp3 files via wget. the website is: Alarm Sounds | Free Sound Effects | Alarm Sound Clips | Sound Bites my command is : wget -rl 2 -e robots=off -A wav,mp3 http://soundbible.com/tags-alarm.html When not using the -A wav,mp3... (2 Replies)
Discussion started by: Narnie
2 Replies

8. UNIX for Advanced & Expert Users

Create an Ignite image on tape from Online IgniteUX image

Hi, (HP-UX 11.11) I need to create a tape image of an igniteUX image created on our igniteUX server. That is to say. I have a "Online" image of the igniteUX of the targeted system but I now need to copy it to a useable TAPE (igniteUX) image so i can build an other server from it that is not... (3 Replies)
Discussion started by: Andrek
3 Replies

9. Shell Programming and Scripting

Just downloaded Python, what now?

Hi i just downloaded Python just to try it out are there any sites or tuts i can get to get me started? thanx (1 Reply)
Discussion started by: SimJim81
1 Replies
Login or Register to Ask a Question