title: Cannot call method "appendChild"
body: <p>I am using HtmlUnit and I'm currently trying to login to a website. The issue is that when I run the code I get a huge error pointing to my <code>getPage(...)</code> line (Code below) and it has the error:</p>
  
  <pre><code>net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: 
  Cannot call method "appendChild" of undefined (script in 
  http://bukkit.org/login from (77, 13) to (85, 14)#84)' I have just 
  tried to use the code to login. It is just like the example code on 
  the website.
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>try(final WebClient web = new WebClient()) {
      final HtmlPage login = web.getPage("http://bukkit.org/login");
      final HtmlForm form = (HtmlForm) login.getElementById("pageLogin");
  
      String username;
      String password;
  
      print("Please enter your username: ");
      username = scanner.nextLine();
  
      print("Please enter your password: ");
      password = scanner.nextLine();
  
      final HtmlTextInput name = form.getInputByName("login");
      name.setValueAttribute(username);
      final HtmlPasswordInput pswd = form.getInputByName("password");
      pswd.setValueAttribute(password);
  
      final HtmlSubmitInput button = form.getInputByValue("Log in");
      button.click();
  }
  </code></pre>
  
  <p>The line causing the error is</p>
  
  <pre><code>final HtmlPage login = web.getPage("http://bukkit.org/login");
  </code></pre>