JSOUP解析iframe谷歌地图

时间:2015-12-02 08:54:01

标签: android google-maps iframe jsoup

我正在尝试从此网站http://hdh.ucsd.edu/mobile/dining/locationmap.aspx?l=39上的Google地图地图解析纬度和经度,但我无法获取任何内容。我怎样才能获得纬度和经度?或者什么查询可以实现这一目标?

Document document = Jsoup.connect(url).get();
Elements elements = document.select("div.place-name");
String LOCATION = elements.text();

2 个答案:

答案 0 :(得分:0)

您提供的此网址没有div.place-name,因为如果您使用firebug进行检查,则该网址位于iframe中。

获取坐标比较困难,因为必须在iframe中使用此URL

iframe标签的src标签有坐标。如果这些是cooridnates q=32.881093211,-117.2406307,您可以使用JSOUP获取iframe并使用自定义正则表达式提取这两个数字。

答案 1 :(得分:0)

您可以从RID|value| ========= 1 |$100 | 2 |$200 | 3 |$100 | 4 |$400 | 5 |$400 | RID|rname| ========= 1 | T01 | 2 | W100| 3 | D03 | 4 | D05 | 5 | T08 | 标记的src属性中读取坐标。该网址包含iframe参数,该参数将为您提供以逗号分隔的坐标。

q