简体   繁体   English

如何从C#的数据表中的给定HTML文档中读取特定数据?

[英]How can I read specific data from given html document in Data Table in c#?

Here is my html document of belarc advisor, I want to read some specific data from it like Operating System, Drives, Memory in Data Table. 这是我的belarc advisor的html文档,我想从中读取一些特定的数据,例如操作系统,驱动器,数据表中的内存。 在此处输入图片说明

Note: I have done such task like read excel files in data grid view. 注意:我已经完成了诸如在数据网格视图中读取Excel文件之类的任务。 But I am not aware about how can I read specific data from html document. 但是我不知道如何从html文档中读取特定数据。

So is it possible to read only specific data from html document? 那么有可能只从html文档中读取特定数据吗?

You might want to take a look at: https://html-agility-pack.net/?z=codeplex 您可能需要看看: https : //html-agility-pack.net/?z=codeplex

Also the default XmlDocument class should be able to parse the HTML. 默认的XmlDocument类也应该能够解析HTML。

Or regular expressions are an option: http://mahmoud-alam.blogspot.com/2008/02/some-times-we-need-to-extract.html 或选择使用正则表达式: http : //mahmoud-alam.blogspot.com/2008/02/some-times-we-need-to-extract.html

What that means is you have to load the page and then look for the datatable you would like to extract. 这意味着您必须加载页面,然后查找要提取的数据表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 c# 从word文档中的特定表和多列读取数据 - c# read data from specific table and multiple columns in word document 如何使用 C# 或 Vue.js 从文本文件中读取特定数据? - How can I read specific data from text file using C# or Vue.js? 如何使用C#从.asc文件中的特定位置读取数据 - How can I read data from specific location in .asc file using c# C#/ WPF如何从文本框读取“绑定”(数据从SQL表获取)? - C#/WPF How can I read “Bindings” from a TextBox (Data gets from a SQL-Table)? 如何从c#中的sql中检索特定数据? - How can I retrieve specific data from sql in c#? 假设我已将网页源存储在字符串变量中,如何阅读C#中的HTML文档? - How do I read HTML Document in C# given that I have the webpage source stored in a string variable? 如何使用C#从指定单元格开始从HTML表读取数据? - How to read data from HTML table starting from specified cell using C#? 使用 HtmlAgilityPack C# 从 html 文档中获取特定表 - Get specific table from html document with HtmlAgilityPack C# 如何从C#文件中读取这4种特定的十六进制数据? - How do I read this 4 specific hex data from a file in C#? 如何在c#中实施此计划以读取所有数据并写入另一个表? - How can I implement this plan in c# to read all data and write another table?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM