title: Java: Get JavaScript Array Elements from page
body: <p>I am at a point where I can pull a single javascript declaration such as:</p>
  
  <pre><code>var cars = ["Saab", "Volvo", "BMW"];
  </code></pre>
  
  <p>parsed from a page.</p>
  
  <p>I would like to be able to get all the elements of the array ("Saab", "Volvo", "BMW") from this declaration.</p>
  
  <p>Should I be using some javascript engine for this, or what else would be the best way to get javascript variable values from my Java code.</p>
  
  <p>I would hate to reinvent the wheel if something is already out there that is able to do this, so I am just looking for advice on something I can use to do this function.</p>