I have a script that is using LWP::UserAgent to parse a web page. I've used to script to parse web pages in the past it has worked fine. I'm currently trying to retrieve a web page that is generated using php. (ie www.webpage.com/webpage.php). The web page in question culls and displays information from a database. When browsing the page through IE, the top of the page (simple text), displays very quickly but then it takes some time for the information to be pulled from the database and displayed. There is a delay between when you see the top part of the page and when the rest of the page loads.
My question is this: When I try to retrieve the web page through perl, all the "text" information is displayed properly, but the information that is pulled from the database is not retrieved by the script. All that my script is doing, is grabbing the web page:
sub getURL
{
my($url, $thegoods,$givecookie,$savecookie,$redirect) = @_;
my $ua=new LWP::UserAgent;
my $request;
$request = new HTTP::Request('GET',$url);
my $response=$ua->request($request);
print $response->as_string();
}
My script runs and finishes very quickly. It takes much longer for the page to load in IE than for my script to run. It is almost as if the webpage is not retrieving the database information.
I know this questions vague, but does anybody have any idea why the information that is being pulled from the database is not being picked up by script?
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.