我有包含经度和纬度的数据,根据我想拥有完整地址的信息,我发现了很多站点
public static void main(String[] args) throws IOException {
String url = "https://www.coordonnees-gps.fr/";
Connection.Response resp = Jsoup.connect(url) //
.timeout(30000) //
.method(Connection.Method.GET) //
.execute();
// * Find the form
Document responseDocument = resp.parse();
Element potentialForm = responseDocument.select("form-
horizontal").first();
checkElement("form-horizontal", potentialForm);
FormElement form = (FormElement) potentialForm;
// * Fill in the form and submit it
// ** Name search
Element textBoxNameSearch = form.select("latitude").first();
checkElement("name search text box", textBoxNameSearch);
textBoxNameSearch.val("48.862725");
System.out.println(textBoxNameSearch.text());
// ** Submit the form
Document searchResults =
form.submit().cookies(resp.cookies()).post();
错误是找不到表单:
Exception in thread "main" java.lang.RuntimeException: Unable to find
form-horizontal