#!/usr/bin/perl use URI::URL; use LWP::UserAgent; use HTTP::Request; use HTTP::Headers; use HTTP::Response; use HTTP::Cookies; use WWW::Mechanize; $month = "3"; $year = "2014"; $url_to_get = 'http://tennislink.usta.com/Tournaments/Schedule/SearchResults.aspx?Action=2&Month=$month&Year=$year&Sanctioned=0&SearchRadius=-1&EntryLevel=False&Intermediate=False&Advanced=False'; $ua = LWP::UserAgent->new; $ua->agent('Mozilla/4.0 (Compatable; MSIE 5.01; Windows NT 5.0)'); $ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1)); $res = $ua->request(HTTP::Request->new(GET => "$url_to_get")); $content = $res->as_string( ); @content = split ("\n", $content); foreach $info (@content) { if ($info =~ "Displaying 1 ") { print "$info\n"; } }