[Tutor] traversing page and then following the link

Emile van Sebille emile at fenx.com
Fri Jul 24 17:29:27 CEST 2009


On 7/24/2009 7:48 AM davidwilson at Safe-mail.net said...
> Hello,
> I would like to download all the flags from the http://en.wikipedia.org/wiki/Gallery_of_sovereign-state_flags so that I can create a flags sprite from this.
> 

You did -- most of the time when you look at a page the files were 
copied onto your machine.

> The flags seem to follow some order in that all the svg files are in the following pattern:
> 
> http://en.wikipedia.org/wiki/File:Flag_of_*.svg and then on this page there is the link of the file.
> 
> I have looked at using Twill to follow each link and record the actual url, but can somone point me at a simpler solution.

Use 'Save As' from the file menu.  Select complete web page.  Et voila!

In python you'd spend a a lot more time getting up to speed on urllib or 
httplib or Beautiful Soup...

Emile



More information about the Tutor mailing list