Welcome to the Monastery | |
PerlMonks |
Project Help: Mechanize::Firefox - Scraping Websites with Javascriptby jdlev (Scribe) |
on Sep 23, 2014 at 11:49 UTC ( [id://1101624]=perlquestion: print w/replies, xml ) | Need Help?? |
jdlev has asked for the wisdom of the Perl Monks concerning the following question:
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:
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
Back to
Seekers of Perl Wisdom
|
|