i want extract comments following link using htmlagilitypackage using c#.the link follows http://www.ndtv.com/india-news/vyapam-scam-documents-show-chief-minister-shivraj-chouhan-delayed-probe-780528 code have created is
var gethtmlweb = new htmlweb(); var document = gethtmlweb.load(txtinputurl.text); var atags = document.documentnode.selectnodes("./div[@class='com_user_text']"); int counter = 1; if (atags != null) { foreach (var atag in atags) { lbloutput.text += lbloutput.text + ". " + atag.innerhtml + "\t" + "<br />"; counter++; } } the variable atags returning null value. have tried using xpath //div[@class='newcomment_list']/ul/li/div[@class='headerwrap']/div[@class='com_user_text'] still same result.please me correct xpath.
thanks in advance
Comments
Post a Comment