Special_K has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to navigate Facebook and access my friends list programatically using WWW::Mechanize::Firefox. I have successfully logged in and navigated to the friends page, but the problem is the friends are not all loaded at once. A portion of them are loaded when the page first loads, and then to get more to load you have to scroll to the bottom of the screen. Getting all friends to load therefore entails repeatedly scrolling to the "new bottom" of the screen each time a new set of friends loads from the previous scroll action. I did some searching on here and saw the suggestion to send javascript through WWW::Mechanize::Firefox, and tried doing this on the friends page:
$mech->eval('window.scrollTo(0, document.body.scrollHeight)');
But that didn't work - instead of scrolling the page down, it took me back to the main page (i.e. the newsfeed). Can anyone give me more detailed information regarding how to programatically scroll the page to the bottom using WWW::Mechanize::Firefox? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize::Firefox and dynamic pages
by Loops (Curate) on Jul 28, 2013 at 00:28 UTC | |
by Special_K (Pilgrim) on Jul 28, 2013 at 06:25 UTC | |
by Special_K (Pilgrim) on Jul 28, 2013 at 07:52 UTC | |
by Corion (Patriarch) on Jul 28, 2013 at 08:04 UTC | |
by Special_K (Pilgrim) on Jul 28, 2013 at 15:49 UTC | |
|