Main Menu
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. Html::TokerParser. get_tag function till I found one with the gallery-img2 class. img tag and got the src attribute.WWW::Mechanize::get to download the image for me.The code is thoroughly commented:
Any feedback, insults and improvements are welcome! :)