jaunt-api を使用して yahoo メールにログインしようとしていますが、「cookie が有効になっていない問題」が発生します。私はjaunt-apiが初めてなので、助けてください。次のコードを使用しています。
try
{
UserAgent userAgent = new UserAgent();
userAgent.setCacheEnabled(false);
userAgent.settings.autoSaveAsHTML = true;
try{
userAgent.cookieJar.saveCookies(new File("e:\\cookie.txt"));
}catch(Exception e){}
userAgent.visit("https://login.yahoo.com/m");
try{
userAgent.cookieJar.loadCookies(new File("e:\\cookie.txt"));
}catch(Exception e){}
Form form = userAgent.doc.getForm(0);
form.setTextField("username", "*****@gmail.com");
form.setPassword("passwd", "*******");
form.submit();
System.out.println(userAgent.doc.innerHTML());
System.out.println(userAgent.getLocation());
}catch(JauntException e){
System.out.println(e);
}