public List <string> GetServices(string element) { List <string> result = new List <string>(); CQ serviceFees = dom[element]; for (int i = 0; i < serviceFees.Count(); i++) { CQ item = serviceFees[i].Cq(); if (item.Parent().HasClass("receipt-panel-body-padding")) { result.Add(item.Text()); } } return(result); }
private static void createDataColumns(CQ htmlTableColumns, DataTable dataTable) { for (var columnIterator = 0; columnIterator < htmlTableColumns.Count(); columnIterator++) { var domObject = htmlTableColumns.Get(columnIterator); string columnName; string caption; if (domObject.InnerText.IsNullOrEmpty()) { columnName = domObject.HasChildren ? domObject.ChildNodes.Item(0).InnerText : $"limiter{columnIterator}"; if (domObject.HasChildren && domObject.ChildNodes.Item(0).NodeName == "ABBR") { caption = domObject.ChildNodes.Item(0).OuterHTML; caption = caption.Replace("<abbr title=", "").Replace($">{columnName}</abbr>", ""); caption = caption.Substring(1, caption.Length - 2); } else { caption = columnName; } } else { columnName = domObject.InnerText; caption = columnName; } dataTable.Columns.Add(new DataColumn { ColumnName = columnName, Caption = caption }); } }