|
Posted by Randall on January 12, 2007, 12:54 am
Please log in for more thread options
I used this code to post a form:
$agent->form(1);
$agent->field("Email", xxxxxxxxxxxt');
$agent->field("Passwd", 'xxxxxxxx');
$agent->untick("PersistentCookie", "yes");
$agent->click();
Here is the page that was returned:
<html> <head> <title> Redirecting </title> <meta content="0;
url='http://video.google.com/'" http-equiv="refresh"> </head> <body
alink="#ff0000" text="#000000" vlink="#551a8b" link="#0000cc"
bgcolor="#ffffff"> <script type="text/javascript"
language="javascript"><!--
location.replace("http://video.google.com/")
//--> </script> </body> </html>
I processed the page like this:
my $link = $agent->find_link();
my $l = $link->url();
print $l;
Output: 'http://video.google.com/'
I then take $l and do a get.
$agent->get($l);
print $agent->uri() . "\n";
Output: http://www.google.com
For some reason when find_link() grabs the link it also grabs the
single quotes around the link. This apparently causes get() to drop
the subdomain??
If I redefine $l without the single quotes like this:
$l="http://video.google.com";
Then the correct page is retrieved.
Has anyone seen this before?
This is my first experience with Mechanize so maybe (probably) I'm
just missing something.
|