簡體   English   中英

如何找到Jsoup的POST鏈接?

[英]How can I find out the link to POST to with Jsoup?

我目前正在嘗試在jsoup中編寫一個程序來登錄mijn.nuon.nl。 當我使用瀏覽器訪問頁面時,我被重定向到一些我的代碼無法訪問的非常長的URL。 有人可以幫助我確定要發布的正確網址,或者看看我的代碼嗎? 非常感謝你

Connection.Response res = Jsoup.connect("https://nuon.nl/service/mijn-nuon").referrer("https://nuon.nl/").userAgent("Mozilla/5.0").timeout(1000 * 100000).followRedirects(true).execute();

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

res= Jsoup.connect(redir.toString()).data("email", username, "password", 
password).data("sessionDataKey","9452a647-8c87-41b8-870a-1b48796b106d")
.method(Connection.Method.POST)
.userAgent("Mozilla/5.0")
.timeout(10 * 1000).execute();

嘗試此操作以獲取最終重定向的網址:

res.url().toString();

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM