public CommonElement(CQ cq) : base(cq.FirstElement()) { string tageName = cq.FirstElement().NodeName; Enum.TryParse(tageName, true, out _htmlTag); _tagName = tageName; }
public static int GetPageCount(char indexLetter) { Uri url = new Uri(Host + "raide/" + indexLetter.ToLower()); CQ dom = RequestForPageDom(url); // Page by default loads on last page CQ pageElements = dom[".activepage"]; int maxPage = Int32.Parse(pageElements.FirstElement().InnerHTML); return(maxPage); }
private static string GetTextFromHtmlStringByCssSelector(string response, string CssSelector) { CQ dom = response; CQ textElement = dom[CssSelector]; string nodeName = textElement.FirstElement()?.NodeName?.ToLower(); string result = textElement.Text(); if (nodeName == "input") { result = textElement.Val(); } return(result); }