title: Selenium Web Driver on Android
body: <p>I recently tried using WebView to extract data from html and ran into an infinite amount of problems, so after searching around I found a Full Library Called Selenium , which had lots of different browser drivers such as Mozilla, Chrome , IE and it also made the Requests cutting out the HTTPRequest part of the app , it also did the work of Parsing the HTML, as it had a built in HTML Parsing Library which was really functional, the Only problem thats is completely stopping me in my tracks is the Fact that it keeps force closing my apps, here is my class:</p>
  
  <pre><code>package com.myapp.webscraper;
  
  import com.myapp.webscraper.AppConfig;
  import android.os.Bundle;
  import android.webkit.WebView;
  import android.webkit.WebViewClient;
  import android.webkit.WebChromeClient;
  import android.support.v7.app.AppCompatActivity;
  import android.widget.EditText;
  import org.openqa.selenium.*;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  
  public class Analytics extends AppCompatActivity{
  
      AppConfig cfg = new AppConfig();
      //WebView Analytics = null;
      EditText console = null;
      @Override
      public void onCreate(Bundle l){
          super.onCreate(l);
  
  
  
          if(cfg.useDebug)
          {
              setContentView(R.layout.analytics_debug);
              String content = "Yellow";
              EditText output = (EditText) findViewById(R.id.debug_analytics_output);
  
              WebDriver driver = new FirefoxDriver();
  
              //driver.get("http://google.co.uk");
             // WebElement body = driver.findElement(By.cssSelector("body"));
             // String content = body.getText();
  
              output.setText(content);
          }
          else
          {
              setContentView(R.layout.analytics);
  
          }
  
  
  
  
          if(cfg.useDebug)
          {
              //console.setText(console.getText() + "\n[URL LOADED]: " + Analytics.getUrl() + "\n");
          }
          else
          {
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>If this library wont run on Android can you recommend any replacements or libraries that will push me forward on my app, it is vital I get this done, Many thanks.</p>