从嵌套的lis中提取HTML页面中的JSON格式的数据

2024-05-29 05:39:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我的数据是在这里找到:https://paste2.org/72LmCn2P

怎么可能从这种JSON中提取数据呢?在

enter image description here

我可以从Firefox的视图中看到,Firefox可以将这个列表转换为一个工作的JSON格式。代码段:

    with urllib.request.urlopen("url") as url:
        soup = BeautifulSoup(url, "html.parser")
        output_file.write(str(json.loads(soup.get_text())))

如何将此类数据转换为有用的转换数据?在


Tags: 数据httpsorg视图jsonurl列表request

热门问题