title: Nashorn parse web page
body: <p>I'm trying to use Nashorn to parse the JS content of a webpage.
  I use the following code to init Nashorn and load the page:</p>
  
  <pre><code>ScriptEngineManager manager = new ScriptEngineManager();
  ScriptEngine eng = manager.getEngineByName("nashorn");
  //...
          URL url = new URL("http://192.168.1.1/userRpm/StatusRpm.htm");
          URLConnection connection = url.openConnection();
          try {
              eng.eval(new InputStreamReader(connection.getInputStream()));
              value = eng.get("mobileParam[0]");
              System.out.println(value);
          } catch (ScriptException ex) {
              Logger.getLogger(Router.class.getName()).log(Level.SEVERE, null, ex);
          }
  </code></pre>
  
  <p>the URLConnection is able to reach the page, I tried to print the output and it worked, but for strange reason, the instruction: <code>eng.eval(new InputStreamReader(connection.getInputStream()));</code> give me the error:</p>
  
  <blockquote>
    <p>Caused by: jdk.nashorn.internal.runtime.ParserException: <code>&lt;eval&gt;</code>:1:0 Expected an operand but found &lt;</p>
  </blockquote>
  
  <p>Maybe I misunderstand how it works. Anyone can explain me better?</p>
  
  <p>the output of URL is:</p>
  
  <blockquote>
    <p>&lt; SCRIPT type="....</p>
  </blockquote>