I tried using WebView for extracting data from html. My issue is that it is completely keeps force closing my apps.
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
{
}
}
}