简体   繁体   中英

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?

    form.submit();

Doesn't work properly. Use method with argument instead

    form.submit(String value);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM