Skip to content Skip to sidebar Skip to footer

How Do I Get Htmlunit To Work Under Android?

Here is my code: import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; final WebClient webClient = new WebClient(); final HtmlPag

Solution 1:

If you just want to get a page and maybe fill out some forms and submit it, jsoup is a good alternative.

I got it working in android with no problems, just add the jsoup.jar to the libs folder.

Here is the simple example

Document doc = Jsoup.connect("http://jsoup.org/")
            .timeout(4000)
            .get();

Or an example submitting data

Connection.Responseres= Jsoup.connect("http://example.org")
                .data("q", username, "password", password) 
                .method(Method.GET)
                .execute();

Documentdoc= res.parse();
System.out.println(doc);

Post a Comment for "How Do I Get Htmlunit To Work Under Android?"