小编Kin*_*. Z的帖子

在 Python 中使用 BeautifulSoup 从 HTML 脚本标签中提取 JSON

我有以下 HTML,我应该如何从变量中提取 JSON:window.__INITIAL_STATE__

<!DOCTYPE doctype html>

<html lang="en">
<script>
                  window.sessConf = "-2912474957111138742";
                  /* <sl:translate_json> */
                  window.__INITIAL_STATE__ = { /* Target JSON here with 12 million characters */};
                  /* </sl:translate_json> */
                </script>
</html>
Run Code Online (Sandbox Code Playgroud)

html python json beautifulsoup

4
推荐指数
1
解决办法
4113
查看次数

标签 统计

beautifulsoup ×1

html ×1

json ×1

python ×1