title: HTMLunit - Facebook Login
body: <pre><code>final WebClient webClient = new WebClient();
      webClient.setJavaScriptEngine(new JavaScriptEngine(webClient));
      HtmlPage page1 = null;
      try {
          page1 = webClient.getPage("http://www.facebook.com");
      } catch (IOException e) {
          e.printStackTrace();
      }
      final HtmlForm form = (HtmlForm) page1.getElementById("login_form");
  
      final HtmlSubmitInput button = (HtmlSubmitInput) form.getInputsByValue("Log In").get(0);
      final HtmlTextInput textField = (HtmlTextInput) page1.getElementById("email");
      textField.setValueAttribute("test@test.com");
      final HtmlPasswordInput textField2 = (HtmlPasswordInput) page1.getElementById("pass");
      textField2.setValueAttribute("password1");
      try {
          HtmlPage page2 = button.click();
          System.out.println(page2.getTitleText());
  
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I'm trying to use the HTMLUnit to log into an account on facebook. However I'm getting this error:</p>
  
  <p>I'm looking to create a program that automates some of the things that I do with my pages that I have on facebook. I know something like this probably already exists but I'm making it for fun.</p>
  
  <pre><code>======= EXCEPTION START ========
  
  
  EcmaError: lineNumber=[97] column=[0] lineSource=[&lt;no source&gt;] name=[TypeError] sourceName=[https://fbstatic-a.akamaihd.net/rsrc.php/v2/y8/r/ElsISGBmlSN.js] message=[TypeError: Cannot find function addImport in object [object CSSStyleSheet]. (https://fbstatic-a.akamaihd.net/rsrc.php/v2/y8/r/ElsISGBmlSN.js#97)]
  com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function addImport in object [object CSSStyleSheet]. (https://fbstatic-a.akamaihd.net/rsrc.php/v2/y8/r/ElsISGBmlSN.js#97)
  </code></pre>