http://www.dsebd.org/latest_PE.php
以上url包含幾個信息。從這個URL我只是想得到波紋管信息。 如何?如何獲取C#變量中的URL信息?
Price Earning Ratio : at a glance
on Aug 2, 2010 at 11:28:00
我想知道如何得到網址信息到一個變量或C#。具體的一些存儲容器,我需要上面的信息,我不需要的信息休息。 我用的波紋管語法:
WebClient objWebClient = new WebClient();
aRequestHTML = objWebClient.DownloadData("http://www.dsebd.org/latest_PE.php");//http://www.dsebd.org/latest_PE_all2_08.php
UTF8Encoding utf8 = new UTF8Encoding();
myString = utf8.GetString(aRequestHTML);
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(myString);
之後做什麼我沒有猜錯的任何thing.Plz表現出一定的語法
foreach (HtmlNode node in doc.DocumentNode.SelectNodes(@"//td"))//td[text()="Price Earning Ratio : at a glance"
{
if (node.InnerHtml.Contains("Price Earning Ratio"))
{
//I get the td value
}
//[text()=Price Earning Ratio : at a glance
// do stuff with node //@"//td[text()=Price Earning Ratio : at a glance"
}
添加上述語法後,我拿出波紋管放
<br>
<font color="#FFFFFF" size="3" face="Arial"><b>Price Earning Ratio : at
a glance <b> </b></b></font><br>
<font color="#FFFFFF" size="2" face="Arial"><b> on Aug 2, 2010 at 17:04:00<b></b></b></font>
<br>
從這裏我只想得到日期的一部分。哦到?沒有這個日期我不需要任何東西。每天這個日期會改變,它是動態的日期,所以我不能內聯這個日期。 從上面看出我如何得到日期。
? – Nealv 2010-08-02 09:05:01