As you can see I'm not really interested in any returned content, I just want to automate several button clicks (each URL is an action performed by a button press) and see that no error was encountered.use strict; require LWP::UserAgent; my $ua = LWP::UserAgent->new (env_proxy => 1, keep_alive => 1, timeout => 30); while(<DATA>) { chomp; my $req = HTTP::Request->new('GET', $_); my $resp = $ua->request($req); if ($resp->is_success) { # print $resp->content; print "OK -----> '", $_, "'\n"; } else { print "FAILED -> '" ,$_, "'\n"; } select((select(STDOUT), $| = 1)[0]); #flush STDOUT buffer } print "Finished.\n" __DATA__ http://www.thehungersite.com/cgi-bin/WebObjects/CTDSites.woa/60/wo/SJ5 +0004g800Ig400Xz/0.0.33.13.0.1.0.0.0.CustomContentActiveImageDisplayCo +mponent.0.0.0 http://www.thebreastcancersite.com/cgi-bin/WebObjects/CTDSites.woa/60/ +wo/SJ50004g800Ig400Xz/2.0.33.13.0.1.0.1.0.CustomContentActiveImageDis +playComponent.0.0.0 http://www.therainforestsite.com/cgi-bin/WebObjects/CTDSites.woa/60/wo +/SJ50004g800Ig400Xz/5.0.33.13.0.1.0.0.0.CustomContentActiveImageDispl +ayComponent.0.0.0 http://www.ecologyfund.com/registry/ecology/03_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/donate_pol.html?noheader=- +1 http://www.ecologyfund.com/registry/ecology/05_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/07_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/04_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/01_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/08_donate.html?noheader=-1 http://www.ecologyfund.com/registry/ecology/02_donate.html?noheader=-1
Some questions:
--Jim
In reply to Simple requests using LWP::UserAgent by jlongino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |