in reply to javascript interpreter in perl???

If you use the module Win32::IE::Mechanize on Windows as an alternative for WWW::Mechanize then it'll execute the Javascript on the web pages it fetches. That happens due to the fact that this module uses the MSIE core to fetch the web pages.

Nevertheless, the idea of being able to use Javascript from within perl (thus, without using a browser core) and have it being able to use the DOM to process a html page does appeal to me. I'd prefer to have some tie-like mechanism for variables and object fields in Javascript, which invokes routines in Perl. Chalk it up on the wishlist...

Replies are listed 'Best First'.
Re^2: javascript interpreter in perl???
by monkster (Sexton) on Feb 26, 2008 at 12:03 UTC
    Sorry for not responding for a long time.. I understand that JavaScript interpreter and DOM must be glued together to solve this.. There's a method in JavaScript::SpiderMonkey called 'function_set' which allows a perl code to be exec thru javascript.. So i thought of implementing the DOM accessing javascript commands thru this method by using HTML::TagParser or HTML::Tree in perl..

    But I encounter a few problems here.. Please see this post to find out them..

    And please help me solve them..

    Thanks a lot..

      I'm interested in looking into this, even though I've never used JavaScript::SpiderMonkey in my life. So it's going to take a while.

      I see you've started looking into HTML::TagParser, and as I currently have some interest in HTML::Tree due to current work on another module (where most work is being done by grandfather), I'm interested of trying that route.

      But don't hold your breath. :)

Re^2: javascript interpreter in perl???
by monkster (Sexton) on Feb 06, 2008 at 11:18 UTC
    Hi.. Tried it with Win32::IE::Mechanize in windows and i was able to get the code.. thanks a lot :)But want it in unix as the main workin platform is that. so still tryin to find a way to access web page and process the javascripts that occur in that. However thanks a ton for the help :)