当我使用直接参数和通过数据对象时,我得到了 2 个不同的结果
测试1:直接连接
String url = "https://wl-prod.sabresonicweb.com/SSW2010/B3QE/webqtrip.html?searchType=NORMAL&lang=en&journeySpan=OW&origin=NGO&destination=SGN&numAdults=1&numChildren=0&numInfants=0&promoCode=&alternativeLandingPage=true&departureDate=2013-12-27";
Document doc = Jsoup
.connect(url)
.userAgent("Mozilla")
.get();
Element tableE = doc.getElementById("dtcontainer-both");
System.out.println(tableE.html());
--> 注意最后一行:货币是日元
测试 2:使用数据对象
String url = "https://wl-prod.sabresonicweb.com/SSW2010/VNVN/webqtrip.html";
Map<String, String> data = new HashMap<String, String>();
data.put("searchType", "NORMAL");
data.put("lang", "en");
data.put("journeySpan", "OW");
data.put("origin", "NGO");
data.put("destination", "SGN");
data.put("numAdults", "1");
data.put("numChildren", "0");
data.put("numInfants", "0");
data.put("promoCode", "");
data.put("alternativeLandingPage", "true");
data.put("departureDate", "2013-12-27");
Document doc = Jsoup
.connect(url)
.data(data)
.userAgent("Mozilla")
.get();
Element tableE = doc.getElementById("dtcontainer-both");
System.out.println(tableE.html());
--> 注意最后一行:货币是 VND
谁能告诉我我错在哪里?