in reply to posting to a form to get results

I had a look at the HTML source of the racing results page. The following fragment defines the post action ...
<form action=monthresultslist.asp method=post> ...
As you can see here, you are posting to the wrong URL.

However, you could use WWW::Mechanize to do the browsing for you...
#!/usr/bin/perl -w use strict; use WWW::Mechanize; my $url = 'http://www.gulfgreyhound.com/officialracingresults.asp'; my $robot = new WWW::Mechanize; $robot->get($url); $robot->form_number('1'); $robot->set_fields('subfolder' => 'dec03'); $robot->click(); # Get the reply to my question my $html = $robot->content(); print "$html";

Replies are listed 'Best First'.
Re: Re: posting to a form to get results
by Anonymous Monk on Dec 24, 2003 at 23:07 UTC
    You guys are great! Thanks for the help!
Re: Re: posting to a form to get results
by ysth (Canon) on Dec 24, 2003 at 22:49 UTC
    Very nice example. I didn't actually look at the HTML source; I just used lynx, hit the submit button, and then '=' to see what page it went to and what the POST data was. Very convenient (for lynx friendly pages, anyway).