0

I want to use JSOUP for a automatical login on the website http://www.footballdatabase.eu. For that I read some advices on stackoverflow, but it didn't help me.

So for make login on current website, I used this code, but it doesn't login:

Connection.Response loginForm = Jsoup.connect("http://www.footballdatabase.eu")
                .data("login", "mylog")
                .data("password", "mypass")
                .method(Connection.Method.POST)
                .execute();


Document document = Jsoup.connect("http://www.footballdatabase.eu")
    .cookies(loginForm.cookies())
    .get();

System.out.println(document);
Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111
Alexey
  • 11
  • 1
  • It seems you are sending this request to the main page of the site. You need to find the URL that actually performs the login, like in this example: http://stackoverflow.com/questions/6432970/jsoup-posting-and-cookie. I took a quick look at the page source but I could not find it straightaway – Tim Dec 16 '16 at 09:13
  • i solved this problem by adding another parametres to connection response such as crealog, connect.x, connect.y. Now it works. – Alexey Dec 16 '16 at 10:03

1 Answers1

1

Solution for my problem:

Connection.Response loginForm = Jsoup.connect("http://www.footballdatabase.eu")
                .data("crealog","1")
                .data("login", "mylogin")
                .data("password", "mypass")
                .data("connect.x","number1")
                .data("connect.y","number2")
                .method(Connection.Method.POST)
                .execute();
    Document doc = Jsoup.connect("http://www.footballdatabase.eu").cookies(loginForm.cookies()).get();
Alexey
  • 11
  • 1