我要分析此文件:(只的重要組成部分)解析HTML頁面與敏捷性包WP8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
...
</head>
<body onload="Xaprb.InputMask.setupElementMasks()">
<div align="center">
<table> ... </table>
<table width="900" height="500" border="0" cellpadding="0"
cellspacing="0" class="content">
<tr>
<td width="45"> </td>
<td width="210" valign="top">
<div class="np_table">
<div class="np_bl">
<div class="np_br">
<div class="np_tl">
<div class="np_tr">
<span class="name_heading">Hello</span><br />
<span class="name_content">**NAME I NEED**</span><br />
<br /> <span class="name_heading">Number:</span><br />
<span class="name_content">**NUMBER I NEED**</span>
</div>
</div>
</div>
</div>
</div> <br>
<div class="menu"> ... </div>
<p> </p>
</td>
<td width="600" valign="top">
<div class="content_table">
<div class="ct_bl">
<div class="ct_br">
<div class="ct_tl">
<div class="ct_tr">
<span class="heading">...</span>
<p><b>**I need this number too: 250**</b> <br />
<br />
Here is the datum I want: **17-04-2014**. <br />
Please do not...</p>
<p><b>...</b></p>
<br /><br>
</div>
</div>
</div>
</div>
</div>
</td>
</body>
</html>
,現在我想四根弦,這兩個數字,日期和名稱。我有這樣的代碼:
HttpClient client = new HttpClient();
var doc = new HtmlAgilityPack.HtmlDocument();
var html = await client.GetStringAsync("http://example.com");
doc.LoadHtml(html);
var name = ???
var numberone = ???
var numbertwo = ???
var date = ???
但我不知道如何成爲HTML敏捷包的這些信息。有人能幫助我嗎?或者給我提示?
你可能會發現這很有用。 [http://stackoverflow.com/questions/846994/how-to-use-html-agility-pack][1] –