#Login to a website and go to a different page after

1 messages · Page 1 of 1 (latest)

pallid solstice
#

I am trying to login to a website and go to a different page after. Here is my code:

Connection.Response res = Jsoup.connect("https://www.shop.exalto.com/profile/login")
                .data("username", myUsername , "password", myPassword)
                .method(Method.POST)
                .execute();

Map<String, String> loginCookies = res.cookies();

Document doc = Jsoup.connect(url).cookies(loginCookies).get();

For some reason the login part does not work and I have no idea how to fix it.

eternal tundraBOT
#

This post has been reserved for your question.

Hey @pallid solstice! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

quiet garden
#

Hi, are you getting any error?

pallid solstice
#

No, it just does not log in, I think I have the wrong login URL but I am not sure how to get it

#

It just executes my code below, which is look up the stock of some products, but the stock is only visible when logged in

quiet garden
#

Could you inspect the "res" variable after the first execute? Is there any message inside?

pallid solstice
#

Well the body is pretty big, but I think it is not the php form

#

My friend is trying to get the php link and I will try again when I have that one I guess

quiet garden
#

Since you said that login is not working and the code is making the second call passing the "loginCookies" I'm thinking that the login cookies are not being returned by the first call. What I would look is the message response from the first call.

pallid solstice
#

I will take a look when I come back from work, thanks!

quiet garden
#

np