小编Bil*_*ung的帖子

使用 htmlparser2 将 html 字符串解析为 json

我正在尝试使用 htmlparser2 ( https://www.npmjs.com/package/htmlparser2 ) 将 html 原始字符串解析为 json。

但它的用法只注销标签/文本,我想要的是像它的 livedemo ( http://demos.forbeslindesay.co.uk/htmlparser2/ ) 这样的 json ,这样我就可以过滤我想要的元素。

任何帮助或建议将不胜感激!

javascript json html-parsing

5
推荐指数
1
解决办法
2514
查看次数

标签 统计

html-parsing ×1

javascript ×1

json ×1