Reputation: 628
I am trying to extract data from a website using Perl. Below is the description of the site:
My question is, how do I execute that JS function so that I could loop through the dates that I need data from?
Thanks in Advance
Upvotes: 1
Views: 322
Reputation: 10666
It's much easy make same HTTP request from your script and get all data you need directly.
You can record all HTTP requests/responses of your browser by using HTTP Fox extension (for Firefox).
Upvotes: 3
Reputation: 70792
Edit
There is a CPAN module:
JavaScript - Perl extension for executing embedded JavaScript
But I've not already tested them.
Original post:
Take a look at smjs
it's Spidermonkey's JS shell.
You could pass javascript by:
open my $jsout,"echo '$javascript' | smjs |" or die;
print <$jsout>;
...
But be care! This take security consideration away!
Upvotes: 2