Thursday, February 9, 2012

Download pictures using lynx and wget

test@test:~$ lynx --source "http://www.funnyjokes.org/" | grep gif
    <td><a href="/"><img src="images/logo.gif" border="0" /></a></td>
<a href="funny_cartoons.aspx"><img src="http://www.martybucella.com/toon.gif" alt="cartoon" width=150 /></a>

test@test:~$ lynx --source "http://www.funnyjokes.org/" | grep http | grep gif | cut -d\" -f4
http://www.martybucella.com/toon.gif
test@test:~$ wget `lynx --source "http://www.funnyjokes.org/" | grep http | grep gif | cut -d\" -f4`
--2012-02-09 16:31:46--  http://www.martybucella.com/toon.gif
Resolving www.martybucella.com... 72.167.131.126
Connecting to www.martybucella.com|72.167.131.126|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14076 (14K) [image/gif]
Saving to: `toon.gif'

100%[====================================================================================================================================================================================================>] 14,076      33.8K/s   in 0.4s  

2012-02-09 16:31:47 (33.8 KB/s) - `toon.gif' saved [14076/14076]
test@test:~$ display toon.gif

No comments:

Post a Comment