【发布时间】:2017-03-17 05:54:31
【问题描述】:
我有一个字符串:
<head>
<script type="text/javascript">window._timings = {"domLoading": Date.now()}</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript">window._sharedData = {"country_code": "IR", "language_code": "en", "gatekeepers": {"cc": true, "sms": true, "ra": true}, "show_app_install": false, "static_root": "//instagramstatic-a.akamaihd.net/h1", "platform": "web"};</script>
<script src="//instagramstatic-a.akamaihd.net/h1/bundles/en_US_ProfilePage.js/88ce62d41e70.js" type="text/javascript" crossorigin="anonymous"></script>
我只需要提取:
{"country_code": "IR", "language_code": "en", "gatekeepers": {"cc": true, "sms": true, "ra": true}, "show_app_install": false, "static_root": "//instagramstatic-a.akamaihd.net/h1", "platform": "web"}
在这方面需要帮助。
【问题讨论】:
-
使用JSoup解析html元素也可以试试JSON解析器