c# - How to select specific node using Html Agility Pack? -
<div class="form-field wide-80 normal">1997-09-15</div>
i trying select date inside 1997-09-15. tried code giving error of "xpath exception unhandled" what's wrong in code please
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); } }
you forget 's
var spannodes = doc.documentnode.selectnodes("//div[@class='form-field wide-80 normal']");
Comments
Post a Comment