Greeings fellow coders,
I'm somewhat new working with perl. I am attempting to automate pulling some information from a wholesale providers website who does not offer an API for it's retailers, i.e. scape some information from a page.
I can successfully login to the https site and navigate to the page which should contain the content, but the "generated content" is missing. So as to not draw a false conclusion, to verify that there is content, I have logged into the site via the browser and indeed there is content. And I can "view source" and see the tabled information I ultimately want to get to via a script. Here is the code I use in my attempt. I've also played aroung with the LPW:UserAgent with less success. For obvious reasons, the site, user, and password has been changed. I am asking for any assistance one might have with much more experience with this. Thank you very much.
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
my $outfile = "out.htm";
my $url = "https://www.mywholesalersite.com/frmLogin.aspx";
my $username = 'user';
my $password = 'passwd';
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
$mech->form_name('Form1');
$mech->field(login => $username);
$mech->field(passwd => $password);
$mech->click();
sleep 3;
# We are now logged in. This is verified by viewing the $mech->conten
+t
$url = 'https://www.mywholesalersite.com/frmReportLineCount.aspx';
$mech->get( $url );
sleep 15; # Allow time for content to be generated
$mech->save_content( $outfile );
exit;