So I've been dabbling with perl lately and this is how I feel today:
I'm going to go through a simple image scraping program I conjured today. I wrote this to scrape images off a t-shirt gallery so that I could help my friend make a choice on his favourite one offline. \()/ Proud to be a nerd \()/
So for perl of course there already are modules on CPAN to help. I'm using two:
My target html looked like this:
My "algorithm" went something like:
WWW::Mechanize::get()to get the page I wanted.
get_tagfunction till I found one with the
imgtag and got the
WWW::Mechanize::getto download the image for me.
The code is thoroughly commented:
Any feedback, insults and improvements are welcome! :)