HtmlAgilityPack从强标记中获取数据

时间:2015-12-03 16:51:09

标签: c# html-parsing html-agility-pack

<strong
data-price-without-addons="&#x20AC;&nbsp;12"
data-price-with-parking=""
data-price-with-internet=""
data-price-with-internet-parking=""
data-component='track' data-track='mouseenter' data-hash='eDUfZZGbBVfXWMHBYWEISLJYbcNKNMC' data-stage='1'
class=" b-tooltip-with-price-breakdown-tracker rooms-table-room-price red-actual-rack-rate"
title=""
>
&#x20AC;&nbsp;12
</strong>

各位大家好,此代码在webbrowser1上。 我想得到'€12。

我试试这个,但这不起作用;

var element = webBrowser1.Document.GetElementsByTagName("strong")
 .Cast<HtmlElement>()
 .Where(ee => !String.IsNullOrEmpty(ee.GetAttribute("class")) &&
 ee.GetAttribute("class") == " b-tooltip-with-price-breakdown-tracker")
 .FirstOrDefault();
有人帮帮我吗?
谢谢,Jimmy Puaa Kuaa。

0 个答案:

没有答案