newBee wrote:
Hi after going over the FAQ and the examples I decided to write a
small script to understand the WWW::Mechanize module. Since Google has
one field and two buttons I thought this would be a straight forward
one. So I wrote the fallowing script. At the end of the script I
thought the script will fill up the Google search text box and give me
the search results but it didn't work. It will be a great help if
someone could take a look at it...

#!/usr/bin/perl

use WWW::Mechanize;

$queryString = 'HelloWorld';
$url = 'http://www.google.com/';
my $mechObject = WWW::Mechanize->new( autocheck => 1 );
$mechObject -> get($url);
print $mechObject -> content;

$mechObject->form_number(1);
$mechObject->field("q", $queryString);
$mechObject->click("btnG");

thanks inadvance,

First of all, before asking for help on this forum please

  use strict;
  use warnings;

at the start of your program, and declare all your variables using 'my'.

Having said that, you program works fine for me. What did you expect it
to do that it fails at?

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to