use*_*106 6 android google-places-api google-places
根据政策,必须在应用中显示"html_attributions".收到的回复是 - "html_attributions":["by by by u003ca href = \"http:// some website.com/\"\u003esSome website\u003c/a\u003e"]
当我将其解析为jObject.getJSONArray("html_attributions")时,我得到 -
["Listings by <a href=\"http:\/\/www.some website.com\/\">some website<\/a>"]
这不能按原样显示,因为它不是正确的HTML.有没有正确解析此属性的方法,以便提取html有效字符串?
它可能有帮助
从谷歌我在这个页面上找到了这个。这是 html 标签,如果我们想要精确的 url,那么我们必须从 xml 解析的 html 字符串中获取。
This is an example of an attribution in JSON format:
"html_attributions" : [
"Listings by \u003ca href=\"http://www.example.com/\"\u003eExample Company\u003c/a\u003e"
],
This is an attribution in XML format:
<html_attribution>Listings by <a href="http://www.example.com/">Example Company</a></html_attribution>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1292 次 |
| 最近记录: |