- Регистрация
- 20.05.2014
- Сообщения
- 122
- Благодарностей
- 4
- Баллы
- 18
Код:
HtmlElement element = instance.ActiveTab.FindElementByAttribute("div", "class", "card-full", "text", 0);
var teg = element.FindChildByAttribute("a", "class", "card-full__main-tag", "regexp", 0).GetAttribute("innerhtml");
var zagolovok = element.FindChildByAttribute("h1", "class", "card-full__title", "regexp", 0).GetAttribute("innerhtml");
HtmlElement anonshtml = element.FindChildByAttribute("div", "class", "card-full__announce", "regexp", 0);//.GetAttribute("innerhtml");
var anons = anonshtml.FindChildByTag("p", 0).GetAttribute("innerhtml");
HtmlElement statya = element.FindChildByAttribute("div", "class", "card-full__text", "regexp", 0);
HtmlElementCollection statyakollekciya = statya.GetChildren(false);
var table_result_xls = project.Tables["Result_xls"];
for (int i = 0; i < statyakollekciya.Count; i++)
{
var soderganie = statyakollekciya.GetByNumber(i);
// существование банеров
HtmlElement sushestvuet = statyakollekciya.GetByNumber(i).FindChildByAttribute("div", "class", "b-adf-banner", "text", 0);
//return sushestvuet.GetAttribute("id");
if (!sushestvuet.IsVoid) {continue;}// else {return "нет";}
// Существуют ссылки на другие статьи
HtmlElement sushestvuet1 = statyakollekciya.GetByNumber(i).FindChildByTag("em", 0);
if (sushestvuet1.IsVoid) {continue;}
//
// return sushestvuet;
lock(SyncObjects.TableSyncer)
{
table_result_xls.AddRow(statyakollekciya.GetByNumber(i).OuterHtml);
}
}
Последнее редактирование: