BrowseSharp
BrowseSharp copied to clipboard
DoClick is not working
Browser browser = new Browser(); browser.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"; browser.Navigate("https://en.vktarget.ru/login/"); IHtmlInputElement login = (IHtmlInputElement) browser.Document.GetElementsByTagName("input").Single(x => x.GetAttribute("placeholder") == "Add your e-mail"); IHtmlInputElement pass = (IHtmlInputElement) browser.Document.GetElementsByTagName("input").Single(x => x.GetAttribute("type") == "password"); IHtmlButtonElement authBtn = (IHtmlButtonElement)browser.Document.GetElementsByTagName("button").Single(x => x.TextContent == "Authorization"); login.Value = "[email protected]"; pass.Value = "12345"; authBtn.DoClick(); // Nothing happens
It also happens with IHtmlAnchorElement