PDA

View Full Version : How to search a word in the Web page using IE::Mechanize


sridevi_1505
06-09-2008, 11:19 AM
Hi All,

I am new to perl, all i wanted to do is to open a javascript based web page (E.G javascript.internet.com) and search for a text(word)in that page.I am using IE::Mechanize.

My code:

use strict;
use warnings;
use Win32::IE::Mechanize;
my $ie = Win32::IE::Mechanize->new( visible => 1 );
$ie->get("http://javascript.internet.com/");
sleep 3;
my $content=$ie->content();
print $content;

i am getting the source in a file and sotring it.

Help me please.

MetalGear
06-10-2008, 12:20 PM
I use IE:Automation package for this purpose.
It does well. try it..

MetalGear
06-10-2008, 12:41 PM
below is an example




use warnings;
use Win32::IEAutomation;
$ie = Win32::IEAutomation->new( visible =>1, maximize =>1);
$ie->gotoURL("www.google.com");
$text = $ie->PageText;
print $text;
$found = $ie->VerifyText("google");
if($found)
{
print "found\n";
}