由纬度经度信息组成的数千条数据。我正在尝试构建一个桌面应用程序,需要将纬度经度转换为人类可读的地址。我认为 Jsoup 就是用于此类任务的。
我希望通过下面的代码在控制台中打印“Belmani, Madhya Pradesh 486669, India”(但似乎连发布也没有完成):
Document doc = Jsoup.connect("http://www.findlatitudeandlongitude.com/find-address-from-latitude-and-longitude")
.data("lat", "24.2")
.data("lon", "82")
.userAgent("Chrome")
.post();
System.out.println(doc.getElementById("address")); // should print html source of address returned
我已经尽力了。 Jsoup 如何完成这项任务呢?上述案例的示例代码?
最佳答案
尝试通过URL参数发送数据:
Document doc = Jsoup.connect("http://www.findlatitudeandlongitude.com/find-address-from-latitude-and-longitude/?lat=24.2&lon=82").get();
System.out.println(doc.getElementById("address"));
关于java - 在这种情况下,Jsoup 如何返回可读地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24935157/