in reply to Visit web-pages using perl

Check out WWW::Mechanize.