LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-20-2011, 03:33 PM   #1
silviolorusso
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
grabbing linked .svg files from a html page with wget


Hello,

I'm trying to download all the linked svg from the following link with wget:

http://openclipart.org/api/search/?query=water

This is the line I tried without success:

Code:
wget -r -l1-np -nd -p -A.svg http://openclipart.org/api/search/?query=water

Any suggestion?

Thanks!
 
Old 10-21-2011, 07:07 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It seems to be an RSS feed, and doesn't return HTML. If you use your browser to 'View Source', you can see that it is not HTML. My guess is that while browsers understand the RSS XML content, wget does not. I used X copy/paste to capture the RSS XML to a file, and then used the following to grab the content:
Code:
for svg in $(perl -e 'while(<>){ if( $_ =~ m/enclosure url="([^"]+\.svg)"/ ){ print $1,"\n";} }' LQsilviolorusso.xml); do 
    wget $svg; 
done
This violates my own insistence not to parse XML without a proper XML parser, but as a one-off, I'll live with myself.

--- rod.

Last edited by theNbomr; 10-29-2011 at 12:22 PM.
 
Old 10-29-2011, 07:27 AM   #3
silviolorusso
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Great thanks!
 
  


Reply



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 - Problems downloading files from a password secured page scrabble Linux - Software 1 07-13-2011 08:18 AM
Grabbing wiki code using wget jgombos Linux - Networking 2 08-02-2010 06:53 AM
wget does not work because of no html files? ufmale Linux - Newbie 1 07-02-2008 11:45 PM
wget html grabbing script linuxhippy Slackware 4 11-25-2005 05:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:44 AM.

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
Open Source Consulting | Domain Registration