Hi all,
I am playing with this module (I need it, it is good), but I have one question about loading complete page, my code snippet:
use strict;
use warnings;
use Win32::IE::Mechanize;
my $ie = Win32::IE::Mechanize->new( visible => 1,
left => 0,
top => 0,
height => 950,
width => 1280,
);
$ie->get('http://www.google.com'); #example!
sleep 5;
$, = "\n";
print my @links = $ie->links;
This works ok, but I have quistion about "sleep 5;". I didn't found any method, which return status of page. I don't want use sleep 5.
in doc I found:
$ie->success
Return true for ReadyState >= 2;
in source is sub success { $_[0]->{agent}->ReadyState >= 2 }
so I played with these values, also put $ie->get in loop, but nothing helps. So there is no workaround and I have to use sleep ?
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.