如何从数据库记录中删除所有 html,而不是创建 xml 文件?

发布于 2024-08-11 21:33:33 字数 101 浏览 2 评论 0原文

我想找出一种方法从数据库中的记录中删除所有 html 标签,然后创建 xml?

有什么想法吗?

基于 asp.net 2.0 和 sql server 构建

Im trying to figure out a way to strip out all html tags from records in a database, then create xml?

Any ideas?

Built on asp.net 2.0 with sql server

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

够运 2024-08-18 21:33:33

检查这个问题:使用 C# 正则表达式删除 HTML 标签 。您所说的创建 xml 到底是什么意思?

Check this question : Using C# regular expressions to remove HTML tags. What exactly did you mean by creating xml?

眉黛浅 2024-08-18 21:33:33

为什么不直接解析页面,确保将其放入 DOM 树中,然后遍历元素,提取出您需要的适当值,以及您认为必要的任何属性。

如果你编写了 html 文件,那么它们应该是格式良好的,所以这会很容易。

Why not just parse the page, ensuring that you make it into a DOM tree, and then just go through the elements pulling out the appropriate values that you need, and perhaps any attributes you deem necessary.

If you wrote the html files then they should be well-formed, so this would be easy.

╭⌒浅淡时光〆 2024-08-18 21:33:33

不要用数据库或 SQL 来剥离 HTML。相反,请在应用程序代码的最后一英里处使用刮刀将其删除。

谷歌搜索:“HTML Scraper”。 HTML屏幕抓取工具读取HTML内容并输出内容,减去HTML。或者,Stack Overflow 也可以这样:“屏幕抓取 HTML”。

Don't strip the HTML with the database or with sql. Instead, strip it out at the last mile in your application code with a scraper.

Google this: "HTML Scraper". HTML screen scraping tools read HTML content and output the content, less the HTML. Or, alternatively, Stack Overflow this: "Screen-scraping HTML".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文