I'd like to add that google is likely to use some defense mechanisms against automatic queries via HTTP.
WWW::Automate tests itself against
http://google.com/ page and I get lots of failures described as "Connection reset by peer" when running several test sessions in sequence.