1

<div class="form-field wide-80 normal">1997-09-15</div>

我正在尝试选择其中的日期 1997-09-15。我尝试了这段代码,但它给出了“Xpath Exception was Unhandled”的错误代码有什么问题请帮助

 string Url = "http://whois.domaintools.com/google.com";

 HtmlWeb web = new HtmlWeb();
 HtmlAgilityPack.HtmlDocument doc = web.Load(Url);

 var SpanNodes = doc.DocumentNode.SelectNodes("//div[@class=form-field wide-80 normal]");
 if (SpanNodes != null)
 {
      foreach (HtmlNode SN in SpanNodes)
      {
          string text = SN.FirstChild.InnerText.Trim();
          MessageBox.Show(text);
      }
 }
4

1 回答 1

1

你忘记'

var SpanNodes = 
       doc.DocumentNode.SelectNodes("//div[@class='form-field wide-80 normal']");
于 2013-04-18T17:10:06.447 回答