我最近下载了 HtmlAgilityPack,但我没有找到任何关于如何使用它的真正说明。我试图根据一些不同的讨论板帖子和其他来源拼凑一些代码。这是我到目前为止所拥有的:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim document As New HtmlAgilityPack.HtmlDocument
document.LoadHtml("www.reuters.com/finance/stocks/overview?symbol=GOOG")
Dim tabletag = document.DocumentNode.SelectSingleNode("//table[@class='data']/tr[1]/td[2]")
End Sub
如您所见,我正在使用来自www.reuters.com/finance/stocks/overview?symbol=GOOG
.
我正在尝试从此页面中提取 Beta 值。该值当前为 1.04。
当我在即时窗口上方运行代码时,会显示此重复 100 次:
1.04
$243,156.41
328.59
--
--
Trading Report for (GOOG). A detailed report, including free correlated market analysis, and updates.
ValuEngine Detailed Valuation Report for GOOG
GOOGLE INC CL A (GOOG) 12-months forecast
GOOGLE INC CL A (GOOG) 2-weeks forecast
Google Inc: Business description, financial summary, 3yr and interim financials, key statistics/ratios and historical ratio analysis.
我只希望返回第一个数字 (1.04)。我究竟做错了什么?有什么建议么?