Hi Guys,
I've been really struggling with this and could use some help. It's frustrating, because I can use google's dev tools, and using jQuery, go in and pick out the variables I need. That being said, I'm open to any suggestions on how to get this done - preferably using perl, but that's not entirely necessary. Here's where I'm at.
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 :)
I love it when a program comes together - jdhannibal
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.