Hello, everyone! I'm having trouble getting WWW::Mechanize::Firefox to scroll down lines or pages in my current window.

What I'm trying to do is navigate through some dialogues that generate a PDF in the window. Then I use xpath to pull the text from a few specific divs. The problem I'm running into is that it only seems to pre-load the first 2 pages of the PDF document and I need to scroll down to load the rest before xpath will snag all of the text I need.

Here is my code:

my $mech = WWW::Mechanize::Firefox->new( activate => 1, ); $mech->get('https://managemymarket.com/managers/acReporting/SalesForMa +rket.aspx?id=2'); $mech->select("#marketID", '1740'); $mech->field("#startDate", '4/1/2015'); $mech->field("#endDate", $date); $mech->click({ selector => '#btnRun' }); my ($window,$type) = $mech->eval('window'); $window->scrollByLines(188);
No scrolling occurs however. Any help would be greatly appreciated!

Cheers,

Nony

UPDATE: Looks like scrollByLines does not work in the built in PDF viewer. However, I was able to iterate through the pages numbers using $mech->field("#pageNumber", $i) to produce the effect that I needed.

In reply to Mechanize::Firefox can't get it to scroll by WonderLemming

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.