private void FillListResponse() { string myWorkAnswer = MyRequest.GetResponse; if (myWorkAnswer == null) { return; } List <ASV> curList = new List <ASV>(); myHTMLParser myParser = new myHTMLParser(); List <Tag> myList = myParser.getTags(myWorkAnswer, "ul"); List <Tag> resList = new List <Tag>(); bool found = false; // вычленяем из всех списков на странице только нужный foreach (Tag item in myList) { foreach (tagAttribute atItem in item.Attributes) { if (atItem.Name == "class" & atItem.Value == "component-list lot-catalog__list") { found = true; break; } } if (found) { resList.Add(item); break; } } foreach (Tag item in resList[0].InnerTags) // заполняем результаты по списку { curList.Add(new ASV(item.InnerTags)); } this.ListResponse = curList; }
private void FillListResponse() { string myWorkAnswer = MyRequest.GetResponse; if (myWorkAnswer == null) { return; } // Разбор результатов //myWorkAnswer = myHTMLParser.NormalizeString(myWorkAnswer); myHTMLParser myHtmlParser = new myHTMLParser(); List <Tag> myTagRes = myHtmlParser.getTags(myWorkAnswer, "table"); List <List <StringUri> > myTable = new List <List <StringUri> >(); foreach (var item in myTagRes) { myTable = myHtmlParser.getOutTable(item); } // LAST myTable - is RIGHT table! this.ListResponse = GetResultTableAsListOfMyObjects(GetResultTableAsList(myTable)); freshResponse = true; }