I'm trying to login into a site using JSoup but I'm having trouble getting a good cookie back.
I'm not sure if the URL or login data is incorrect. Any help would be much appreciated.
The login page is here
I'm currently trying with the following code:
Connection.Response res = Jsoup.connect("https://go.sfu.ca/psp/goprd/?cmd=login&languageCd=ENG")
.data("user", "myUserID", "pwd", "myPassword")
.method(Connection.Method.POST)
.execute();
I do not get the same amount of cookie information if I were
to login in a browser and cannot request the pages that are required for you to be logged in.
Any help would be greatly appreciated!!
Thanks.
解决方案
I was missing the Login parameter in the form. After including that I was able to get a good cookie back.