Пример #1
0
        public virtual async Task <bool> SubmitFormAsync(string url = null, HtmlElement clickedElement = null)
        {
            XElement formElement = null;

            if (this.Element.HasAttributeCI("form"))
            {
                formElement = this.Element.Document.Descendants().Where(e => e.HasAttributeCI("id") && e.GetAttributeCI("id").Equals(this.Element.GetAttributeCI("form"))).First();
            }
            else
            {
                formElement = this.Element.GetAncestorCI("form");
            }

            if (formElement != null)
            {
                FormElement form = this.OwningBrowser.CreateHtmlElement <FormElement>(formElement);
                return(await form.SubmitFormAsync(url, clickedElement));
            }
            return(false);
        }