开发者

Extract Specific Text from Html Page using htmlagilitypack

Hello i am using htmlagilitypack in my program its build in c# WPF I acually Extract all html page . know i dont know how to mine it

Html page is look like this

<tr>
<th rowspan="4" scope="row">General</th>
<td class="ttl"><a href="network-bands.php3">2G Network</a></td>
<td class="nfo">GSM 850 / 900 / 1800 / 1900 </td>
</tr><tr>
<td class="ttl"><a href="network-bands.php3">3G Network</a></td>
<td class="nfo">HSDPA 900 / 1900 / 2100 </td>
</tr>

I only want to extract from html page is GSM 850 / 900 / 1800 / 1900 These texts but i am not able to extract it please some one help me with this

Currently i am trying this code i 开发者_高级运维find on stackoverflow

foreach (var script in doc.DocumentNode.Descendants("script").ToArray())
    script.Remove();
foreach (var style in doc.DocumentNode.Descendants("style").ToArray())
    style.Remove();

i am not sure how to extract the specific text from html page never done before .


How about:

var text = document.getElementsByClassName("nfo")[0].innerHTML;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜