Hi fellow Monks,

I'm trying to figure out how I can get a webpage and render the JavaScript on that page and then take action based on what is rendered from the JS.

I've pretty much figured out how to get the webpage with LWP and some related modules. I haven't figured out how to make perl interpret the JavaScript on the pages. Can someone help me here?

Some background in case I'm doing this completely wrong. My friend wants a script that will log into his Belkin F5D7230-4 router and grab the WAN IP and then publish write that to a file on an external webserver he manages. He's not interested in using dyndns, whatsmyip.com or similar services.

I think I'm logging into the router correctly, but the index.html page is full of JavaScript that needs to be interpreted first before any meaningful information can be obtained.

So if there's a better way to get this guy's external IP address for him within the constraints provided, please let me know that too.

Thanks in advance.


In reply to Interpert/render JavaScript from a page by xorl

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.