mckfuller has asked for the wisdom of the Perl Monks concerning the following question:

Aloha,

I am trying to write an application to navigate through a web site that uses a lot of javascript. A lot of it is to determine what uri fragment to append to the current uri for navigation. There is other, more meaty, javascript that I'm not sure I can duplicate easily in my code. Is there a way to "run" the javascript as I am traversing the site?

No pressure or anything, but if I don't figure this out soon, I'm up a creek.

Aloha,
mckfuller
  • Comment on Javascript and Web-site navigation using LWP, et. al

Replies are listed 'Best First'.
Re: Javascript and Web-site navigation using LWP, et. al
by jpeg (Chaplain) on Jun 11, 2005 at 01:56 UTC
    I haven't used it myself, but JavaScript::SpiderMonkey and the javascript.pm modules both say they can eval js code by providing interfaces to two different javascript engines.

    I could have sworn I saw someone talking about a subclass of WWW::Mech that spoke javascript, but I guess I was wrong.

    --
    jpg
Re: Javascript and Web-site navigation using LWP, et. al
by dpavlin (Friar) on Jun 11, 2005 at 16:06 UTC
Re: Javascript and Web-site navigation using LWP, et. al
by thcsoft (Monk) on Jun 11, 2005 at 01:09 UTC
      I would actually recommend to not look at the above mentioned packages.. because I did, and they create javascript structures, not parse them.

      I'm sorry I can't offer any more help. You may have a legitimate requirement to parse javascript on webpages, but as far as I know this is near impossible.. I'm most curious to see if you get a better answer in this forum!

Re: Javascript and Web-site navigation using LWP, et. al
by sh1tn (Priest) on Jun 11, 2005 at 02:08 UTC
    You may want to try Form Builder which generates js on the fly.


      You and thcsoft both have the wrong idea.