/// <summary> /// /// </summary> public static HtmlElement GetElementByID(this HtmlWindow elFrame, string value) { if (elFrame.IsNull() || elFrame.Document.IsNull()) { return(null); } return(elFrame.Document.GetElementById(value)); }
public static HtmlWindow GetWindowFrame(this HtmlWindow frame, string frameName) { if (!frame.IsNull() && !frame.Document.IsNull() && !frame.Document.IsNull() && !frame.Document.Body.IsNull() && !frame.Document.Body.OuterHtml.IsNull() && frame.Document.Body.OuterHtml.Contains(frameName)) { return(frame.Document.Window.Frames[frameName]); } return(null); }
public static HtmlElement GetElementByTag(this HtmlWindow elFrame, string tagName, string value) { if (elFrame.IsNull() || elFrame.Document.IsNull()) { return(null); } HtmlElementCollection elCol = elFrame.Document.GetElementsByTagName(tagName); foreach (HtmlElement elItem in elCol) { if (elItem.GetData().Contains(value)) { return(elItem); } } return(null); }
public static HtmlElement GetElementByTag(this HtmlWindow elFrame, string tagName, string attributeName, string value, HtmlElement el = null, bool contains = false) { if (elFrame.IsNull() || elFrame.Document.IsNull()) { return(null); } HtmlElementCollection elCol = el.IsNull() ? elFrame.Document.GetElementsByTagName(tagName) : el.GetElementsByTagName(tagName); foreach (HtmlElement elItem in elCol) { if (elItem.HasAttributeData(attributeName, value, contains)) { return(elItem); } } return(null); }