On Tue, Dec 30, 2008 at 18:50, bft <b...@bft1.org> wrote: > Hi all, > I am trying to interface with a work timesite server, and the site uses > javascript. I am first presented with a login page (username, password) and > then my current weeks timecard after successful login. > > My question is do you think I should try to brute force through the page > using mechanize or use something like javascript-spiderMonkey? I've never > used spider before and I'm not sure I am on the right path in using it. I > have been trying, unsuccessfully, for a long time to automate my access to > this site. > > Has anyone used spiderMonkey to interact with a javascript page? > > Thanks in advance for any info you can provide. snip
When we talk about JavaScript in relation to web pages we really mean two things: the Document Object Model (DOM) and a JavaScript interpreter that has access to the DOM as well as the code provided on the page (or linked to). The JavaScript::SpiderMonkey module only provides one half of what you need. There is a project (WWW::Mechanize::Plugin::JavaScript) to bring the DOM and JavaScript together inside of WWW::Mechanize, but it looks like it has a long way to go before it is ready for anything but experimental stuff (it relies on an experimental version of WWW::Mechanize and is not easy to install). While we wait for that module to become more robust the only options left are Mozilla::Mechanize** (if you are on Linux) and Win32::IE::Mechanize*** or Win32::IEAutomation**** (if you are on Win32). * http://search.cpan.org/dist/WWW-Mechanize-Plugin-JavaScript/lib/WWW/Mechanize/Plugin/DOM.pm ** http://search.cpan.org/~slanning/Mozilla-Mechanize/lib/Mozilla/Mechanize.pm *** http://search.cpan.org/dist/Win32-IE-Mechanize/lib/Win32/IE/Mechanize.pm **** http://search.cpan.org/dist/Win32-IEAutomation/lib/Win32/IEAutomation.pm -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/