$month = "1" $year = "2013" #### $url_to_get = 'http://tennislink.usta.com/Tournaments/Schedule/SearchResults.aspx?Action=2&Month=1&Year=2013&Sanctioned=0&SearchRadius=-1&EntryLevel=False&Intermediate=False&Advanced=False'; #### $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'; #### #!/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"; } } #### cat lwp* #LWP-Cookies-1.0 Set-Cookie3: BigIPCookie=3658774282.20480.0000; path="/"; domain=tennislink.usta.com; path_spec; expires="2013-12-12 23:07:09Z"; version=0 Set-Cookie3: tennislink.usta.com_Search="Action=2&Keyword=&TournamentID=&SectionDistrict=&City=&State=&Zip=&Month=0&Day=&Year=0&Division=&Category=&Surface=&OnlineEntry=0&DrawsSheets=0&PageNum=0&UserTime=&Sanctioned=0&AgeGroup=&SkillLevel_EntryLevel=False&SkillLevel_Intermediate=False&SkillLevel_Advanced=False&SearchRadius=-1&QuickSearch=0&OrderBy=3"; path="/"; domain=tennislink.usta.com; path_spec; expires="2014-06-12 18:07:08Z"; version=0