rediffusion
11/7/2017 - 12:41 PM

Парсинг

Tab Tab1 = instance.ActiveTab;

string strAuthor = "НТВ";
string strXPath = "//div[starts-with(@class,'userContentWrapper')]/descendant::a[contains(@class,'lfloat')]/following::h5[1]/descendant::a[text()='" + strAuthor + "']/following::a[starts-with(@class, 'UFILikeLink')][1]";
HtmlElementCollection colLikes = Tab1.FindElementsByXPath(strXPath);
project.SendInfoToLog(String.Format("Всего найдено постов: {0}", colLikes.Count));

foreach (HtmlElement elLike in colLikes.Elements) {
    //elLike.ScrollIntoView();
	elLike.RiseEvent("click", instance.EmulationLevel);
	Thread.Sleep(1500);
}

//div[starts-with(@class,'userContentWrapper')] - отдельный пост
//div[starts-with(@class,'userContentWrapper')]/descendant::a[contains(@class,'lfloat')]/following::h5[1]/descendant::a[text()=''] - имя автора. InnerHtml
//div[starts-with(@class,'userContentWrapper')]/descendant::a[starts-with(@class, 'UFILikeLink')] - ссылка нравится