jdlev has asked for the wisdom of the Perl Monks concerning the following question:
Based on suggestions I've rec'd, I decided to make a go with Mechanize::Firefox. So far, I've been able to get my program to open firefox and go to the correct page. The problems come when I need to execute some actions. Once it gets to the page, here's what I'd like it to do:
From the HTML source code, I've found that there is a javascript object variable that I'd like to parse. It appears to be setup as a hex with keys. Since it renders to html, I assume I should be able to parse it and pull the data I need? Here is the code from the site:
<script type="text/javascript"> Realtime.setPusherDelay(0); var myContests = [{"n":"Fantasy +League","a":20.0000,"id":334455"}, </script>
So basically, how would I go in there and pull the 'n:' variable or the 'id' variable? TIA :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Project Help: Mechanize::Firefox - Scraping Websites with Javascript
by Corion (Patriarch) on Sep 23, 2014 at 11:57 UTC | |
by jdlev (Scribe) on Sep 23, 2014 at 15:08 UTC | |
by Corion (Patriarch) on Sep 23, 2014 at 15:28 UTC | |
by jdlev (Scribe) on Sep 23, 2014 at 15:43 UTC | |
by Corion (Patriarch) on Sep 23, 2014 at 16:51 UTC | |
| |
|
Re: Project Help: Mechanize::Firefox - Scraping Websites with Javascript
by LanX (Saint) on Sep 23, 2014 at 11:57 UTC |