I have a problem with connect to Digikey.it with jsoup. I need login with my account and use cookies, but when i execute post, do not login. This is my code:
String UrlLogin="https://www.digikey.it/classic/RegisteredUser/Login.aspx?ReturnUrl=%2fclassic%2fregistereduser%2fmydigikey.aspx%3fsite%3dit%26lang%3dit&site=it&lang=it";
Connection.Response response = Jsoup.connect(UrlLogin)
.method(Connection.Method.GET)
.execute();
Document loginPage = response.parse();
response = Jsoup.connect(UrlLogin)
.data("ctl00$ctl00$mainContentPlaceHolder$mainContentPlaceHolder$txtUsername", "username")
.data("ctl00$ctl00$mainContentPlaceHolder$mainContentPlaceHolder$txtPassword", "password")
.data("ctl00$ctl00$mainContentPlaceHolder$mainContentPlaceHolder$btnLogin", "Accesso")
.cookies(response.cookies())
.method(Method.POST)
.followRedirects(true)
.execute()
doc = response.parse();
Who can help me?
You can log in with this code: