Subject: | Forms functions can find forms on certain webpages |
I have been coding a script to access a stock website. I seek to use the main
"quote" form in order to get quotes on certain stocks.
I can see the <form> HTML tags in the web page source, yet
Mechanize cannote seem to find any forms on the page. The code follows:
use strict;
use WWW::Mechanize;
use HTML::TokeParser;
my @symbols = ("QQQQ","MDY","IBM"); # just some test cases
my $agent = WWW::Mechanize->new();
my $r = $agent->get("http://finance.yahoo.com", ":content_file" => "mainpage.html" );
print $r->is_error;
print $agent->forms;
$agent->form_name("quote");
$agent->field('s' => $symbols[0]);
$agent->submit();
//////
print $agent->forms prints nothing, the interpreter claims a form called "quote" does not exist, and therefore the call to field fails.
Any suggestions?