private void PrivateNavigate(GeckoDocument document, String url) { var aa = document.GetElementsByClassName("naver"); document.GetElementByClassName <GeckoAnchorElement>("naver").Href = url; document.GetElementByClassName <GeckoAnchorElement>("naver").Click(); }
public static ScrapTable SelectTableByClass(this GeckoDocument document, String classname, int index = 0) { ScrapTable ret = new ScrapTable(); GeckoElement element = document.GetElementsByClassName(classname)[index] as GeckoElement; var collection = element.GetElementsByTagName("TR"); foreach (var row in collection) { foreach (var col in row.ChildNodes) { if (!(col is GeckoHtmlElement)) { continue; } var buffer = col as GeckoHtmlElement; if ("TD".Equals(buffer.TagName) || "TH".Equals(buffer.TagName)) { //ret.Set(col.TextContent); //ret.Set((col as GeckoHtmlElement).OuterHtml); ret.Set(col as GeckoHtmlElement); } } ret.Next(); } return(ret); }
public static T GetElementByClassName <T>(this GeckoDocument document, String classname, int index = 0) where T : GeckoElement { return(document.GetElementsByClassName(classname)[index] as T); }
/// <summary> /// /// </summary> /// <param name="document"></param> /// <returns></returns> private GeckoHtmlElement getGeckoHtmlElementSendConfirmCode(GeckoDocument document) { GeckoHtmlElement sendConfirmCode = (GeckoInputElement)document.GetElementsByClassName("w x y z ba").FirstOrDefault(); if (sendConfirmCode != null && (sendConfirmCode.GetAttribute("value") == "Send Confirmation Code" || sendConfirmCode.GetAttribute("value") == "Gửi mã xác nhận")) { return sendConfirmCode; } return null; }