Search code examples
javaformsgoogle-app-enginejaunt-api

Running Jaunt (web-scraper) on Google App Engine: Java


I'm trying to submit a form through App Engine and Jaunt. I get this error:

java.lang.NullPointerException
    at com.jaunt.UserAgent.a(SourceFile:2337)
    at com.jaunt.UserAgent.send(SourceFile:887)
    at com.jaunt.component.Form.submit(SourceFile:1263)
    at ewohnat.server.parse.MyServlet.doJaunt(MyServlet.java:118)

when I try to run this code:

UserAgent userAgent = new UserAgent();
userAgent.visit("www.someurl.com");
Form form = userAgent.doc.forms[0];
form.setCheckBox("cb", true);
form.submit();

The exception is thrown on the last line. Any ideas?


Solution

  •     form.submit();
    

    Doesn't work properly. Use method with argument instead

        form.submit(String value);