Click here to get back home

WWW::Mechanize single quotes around url

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
WWW::Mechanize single quotes around url Randall 01-12-2007
Get Chitika Premium
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.


Similar ThreadsPosted
Side effects of overloading quotes "" November 28, 2007, 3:07 pm
Single API to read and edit MP3 and WMA audio files April 29, 2005, 6:39 am
does SQL::Abstract only formulate queries for a single table? December 26, 2005, 5:52 am
Help with Mechanize January 15, 2007, 3:14 pm
WWW::Mechanize v 1.03_01 August 3, 2004, 9:57 pm
Mechanize question November 8, 2004, 10:57 pm
WWW:Mechanize with Menu September 9, 2006, 9:13 pm
WWW:Mechanize problem? January 29, 2007, 7:00 am
WWW::Mechanize "There is no Form named (...)" December 8, 2004, 5:58 am
win32::ie::mechanize PROBLEM December 10, 2004, 7:06 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap