For some reason this code will not let me into the website when I use the correct login information. The System.out.println
posts the code of the login page, indicating my code did not work. Can someone tell me what I'm forgetting or what's wrong with it?
public void connect() {
try {
Connection.Response loginForm = Jsoup.connect("https://www.capitaliq.com/CIQDotNet/Login.aspx/login.php")
.method(Connection.Method.GET)
.execute();
org.jsoup.nodes.Document document = Jsoup.connect("https://www.capitaliq.com/CIQDotNet/Login.aspx/authentication.php")
.data("cookieexists", "false")
.data("username", "myUsername")
.data("password", "myPassword")
.cookies(loginForm.cookies())
.post();
System.out.println(document);
} catch (IOException ex) {
Logger.getLogger(WebCrawler.class.getName()).log(Level.SEVERE, null, ex);
}
}