title: Parsing Javascript using Ruby code
body: <p>I'm writing a test code in Ruby and trying to parse a HTML source file of a website. It has a JavaScript variable which I can use to compare it against other values. For example:</p>
  
  <pre><code>&lt;script type="text/javascript" language="JavaScript"&gt;
    function GetParam(name) {   
      var req_var = {
        a: 'xyz', 
        b: 'yy.com', 
        c: 'en', 
        d:0, 
        e: 'y'
       };
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here I want to extract the variable <code>req_var</code> from this function. Is it possible to do that? If so can anyone please help me with that?</p>