0
我試圖將表單發送到網站並在Android應用程序中獲取響應。事情是,響應只是空的HTML文件(只是標籤HTML,頭部和身體,打開和關閉),僅此而已。 這裏是我的代碼:無法從Jsoup發回郵件
Connection.Response loginForm = Jsoup.connect("http://m.correios.com.br/movel/calculaPrecos.do").method(Connection.Method.GET)
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.0 Safari/537.36")
.execute();
Document document = Jsoup
.connect("http://m.correios.com.br/movel/precos.do")
.userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.0 Safari/537.36")
.data("servico", "40215")
.data("cepOrigem", "97010-200")
.data("cepDestino", "97015-259")
.data("peso", "1")
.data("formato", "1")
.data("comprimento", "23")
.data("altura", "23")
.data("largura", "23")
.data("diametro", "")
.data("maoPropria", "N")
.data("valorDeclarado", "")
.data("avisoRecebimento", "N")
.data("metodo", "calcular")
.cookies(loginForm.cookies())
.followRedirects(true)
.method(Connection.Method.POST)
.post();
System.out.println("Output>>> "+document.toString());
the form which i got from chrome
上帝,還沒有看到它......謝謝! –