Skip to main content
 首页 » 编程设计

C#读取html标签中的数据

2024年02月23日15lyj

如何读取 html 标记之间的数据,例如 <strong> .例如。

<strong id="food">40</strong> 

如何从那里检索整数 40?我试过了

myBrowser.Document.GetElementById("food").GetAttribute("value");

请您参考如下方法:

您正在寻找 InnerHtml 属性。