I want to scrape a block of data from a series of pages that have the data tucked away in a JSON object inside of a script tag. I'm fairly comfortable with BeautifulSoup, but I think I might be barking up the wrong tree trying to use it to get data from JavaScript.
The structure of the pages is, roughly, this:
...
<script>
$(document).ready(function(){
var data = $.data(graph_selector, [
{ data: charts.createData("Stuff I want")}
])};
</script>
The head and body have a zillion scripts each, but there's only one var data
per page. I'm not sure how I'd identify this particular <script>
for BeautifulSoup except by the presence of var data
Can I do this? Or do I need another tool?