低代码,高效而简洁;支持正则表达式,复杂的场景也能很容易提取数据。
使用 YAML 来配置解析,可高效管理输出 JSON 结构
以下是最简单的解析形态,有个更复杂 SERP 例子在 git 中可作为学习参考。
tree:
nodes:
title:
selector: title
body:
selector: body
attr: html
to_markdown: true
<html lang="en">
<head>
<title>Cheerio Tree</title>
</head>
<body>
<h1>Cheerio Tree</h1>
<main>
<h2>What is Cheerio Tree?</h2>
<p><b>Cheerio Tree</b> is a powerful utility built on <b>Cheerio</b>, designed for efficient DOM parsing. It enables rapid conversion of HTML data into JSON format. When paired with YAML, it provides an intuitive and streamlined approach to data handling and transformation.</p>
</main>
</body>
</html>
{
"title":"Cheerio Tree",
"body":"Cheerio Tree\n============\n\nWhat is Cheerio Tree?\n---------------------\n\n**Cheerio Tree** is a powerful utility built on **Cheerio**, designed for efficient DOM parsing. It enables rapid conversion of HTML data into JSON format. When paired with YAML, it provides an intuitive and streamlined approach to data handling and transformation."
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.