小编Kuc*_*ova的帖子

如何在Nodejs中读取和解析html?

我有一个简单的项目。我需要帮助,这是一个相关项目。我需要读取 HTML 文件,然后将其转换为 JSON 格式。我想以代码和文本形式获取匹配项。我如何实现这一目标?

这样我就有了两个HTML标签

<p>In practice, it is usually a bad idea to modify global variables inside the function scope since it often is the cause of confusion and weird errors that are hard to debug.<br />
If you want to modify a global variable via a function, it is recommended to pass it as an argument and reassign the return-value.<br />
For example:</p>

<pre><code class="{python} language-{python}">a_var = 2

def a_func(some_var):
    return 2**3

a_var = a_func(a_var)
print(a_var)
</code></pre> …
Run Code Online (Sandbox Code Playgroud)

html parsing node.js

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

html ×1

node.js ×1

parsing ×1