title: Accessing script content with cheerio
body: <p>I'm using Cheerio and request with Node.js to do some basic web scraping, but can't seem to figure out how to access the data. The page loads via request and I'm able to console.log the page title using Cheerio, but when I get to the scripts it's a complex mess of objects.</p>
  
  <p>In the body section of the page it looks like..</p>
  
  <pre><code>&lt;body&gt; 
    &lt;script src="someUrl" script type="text/javascript" /&gt; 
    &lt;script src="someUrl" script type="text/javascript" /&gt; 
    &lt;script src="someUrl" script type="text/javascript" /&gt;
    &lt;script type="text/javascript"&gt;var months = [6,12,24,36,48,60]; var amounts = [5000,10000,15000,20000,25000]&lt;/script&gt;
  </code></pre>
  
  <p>I'm trying to get to the variables in the last script to store them as variables in my node script for use, but I can't seem to access them, even as text.</p>
  
  <p>When I try this in node, I get the page title followed by some huge object response in the console, not the variable text to parse.  Suggestions?</p>
  
  <pre><code>$ = cheerio.load(body);
  console.log($('title').text());
  var text = $('script');
  console.dir(text[3]);
  </code></pre>