Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SHTTP Search Problem 1

Status
Not open for further replies.

dannite

Programmer
Jun 12, 2008
2
I need to log in to a secure site and perform some automated searching. I have the secure login working fine, but the search is returning so results with search strings that yield results on a browser.

I assume that something I am doing is making it impossible for the Javascript that runs the page to access its database.

Any help would be awesome.



#!c:\\perl\\bin
use strict;
use warnings;
use use HTTP::Cookies;

#use LWP::Debug qw(+);

my $outfile = "out.htm";
my $url = "my $username = "bdaniel2";
my $password = "dannite3";


my $mech = $mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->form_name('Login');
$mech->field(USER => $username);
$mech->field(PASSWORD => $password);
$mech->click();



$mech->form_name('personxref');
$mech->field(inpSearchPattern => "Daniel");
$mech->field(inpFirstName => "Bruce");
$mech->click();




my $output_page = $mech->content();
open(OUTFILE, ">$outfile");
print OUTFILE "$output_page";
close(OUTFILE);
 
does not support javascript (see the modules documentation), so if there is javascript in the page you are accessing it will not work. Maybe someone knows of a work around. You can try IE::Mechanize ( might not be the correct name ) which I am pretty sure will support javascript.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I'll try that out.

Does it make any difference the form that I deal with to search is html,or is the mere presence of javascript throwing it off?
 
If what you want to do with requires that javascript be run, it will not work. If the form on the website you access uses javascript in anyway it will most likely not work. The other module is called Win32::IE::Mechanize


probably has other Win32 dependencies, you will have to check into that.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top