having a problem with selecting the text contain within a particular node on HTML Page. I haven't used XPath before but using the HAP Explorer this was the path given for the text I wanted
string xpath = "/html[1]/body[1]/div[2]/div[4]/div[1]/div[3]/div[4]/div[1]/div[6]/div[1]/div[4]/div[5]/table[1]/tr[1]/td[2]/span[1]";
//Using WatiN for Browser Control
IE ie = new IE(url);
ie.WaitForComplete();
var html = new HtmlDocument();
html.LoadHtml(ie.Html);
//Test HTML Loads
string test = html.DocumentNode.InnerHtml;
HtmlNode node = html.DocumentNode.SelectSingleNode(xpath);
Node always returns NULL.
我相信IE XPath的某些版本是基于0的……因此您需要从每个“数组”索引中减去1。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.