我想解析此网站http://www.nasdaq.com/symbol/goog/financials?query=income-statement。我试图得到价值50,175,000。它是2012年12月31日列中的总收入行。Google Chrome提供的XPath不正确
如果您转到“工具”然后选择“开发人员工具”并右键单击该节点,Google Chrome会提供XPath。初始的XPath是//*[@id="financials-iframe-wrap"]/div/table/tbody/tr[2]/td[3]
我改变了双引号单打所以现在我有这个//*[@id='financials-iframe-wrap']/div/table/tbody/tr[2]/td[3].
但是当我尝试使用这个XPath我收到此错误信息An unhandled exception of type 'System.NullReferenceException' occurred in Nasdaq Parsing Test.exe
Additional information: Object reference not set to an instance of an object.
这里的较大部分我的代码:
Dim Total_Revenue = document.DocumentNode.SelectSingleNode("//*[@id='financials-iframe-wrap']/div/table/tbody/tr[2]/td[3]")
TextBox_Total_Revenue.Text = Total_Revenue.InnerText
任何意见将不胜感激!提前致谢!
的可能重复的[谷歌电子表格的xpath仅选择阵列的代替单值](http://stackoverflow.com/questions/17317614/google-spreadsheet-xpath-仅-选择阵列-代替-的单值) –