title: Selendroid as a web scraper
body: <p>I intend to create an Android application that performs a headless login to a website and then scrape some content from the subsequent page while maintaining the logged-in session.</p>
  
  <p>I first used <a href="http://htmlunit.sourceforge.net/">HtmlUnit</a> in a normal Java project and it worked just fine. But later found that HtmlUnit is not compatible with Android. </p>
  
  <p>Then I tried <a href="http://jsoup.org/">JSoup</a> library by sending HTTP “POST” request to the login form. But the resulting page does not load up completely since JSoup won't support JavaScript.</p>
  
  <p>I was then suggested to have a look on <a href="http://selendroid.io/">Selendroid</a> which actually is an android test automation framework. But what I actually need is an Html parser that supports both JavaScript and Android. I find Selendroid quite difficult to understand which I can't even figure out which <a href="http://search.maven.org/#search%7Cga%7C1%7Cselendroid">dependencies</a> to use.</p>
  
  <ul>
  <li>selendroid-client</li>
  <li>selendroid-standalone</li>
  <li>selendroid-server</li>
  </ul>
  
  <p>With <a href="http://www.seleniumhq.org/"><strong>Selenium WebDriver</strong></a>, the code would be as simple as the following. But can somebody show me a similar code example for <strong>Selendroid</strong> as well?</p>
  
  <pre><code>    WebDriver driver = new FirefoxDriver();
      driver.get("https://mail.google.com/");
  
      driver.findElement(By.id("email")).sendKeys(myEmail);
      driver.findElement(By.id("pass")).sendKeys(pass);
  
      // Click on 'Sign In' button
      driver.findElement(By.id("signIn")).click();
  </code></pre>
  
  <p>And also,</p>
  
  <ol>
  <li>What dependencies to add to my Gradle.Build file?</li>
  <li>Which Selendroid libraries to import?</li>
  </ol>