HtmlElement head = browser.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = browser.Document.CreateElement("script"); IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement; element.text = "function enterJackpot() { $('#submit-wager').trigger('click'); }"; head.AppendChild(scriptEl); browser.Document.InvokeScript("enterJackpot");
No need to declare a script block, once the browser has loaded you can execute a string of javascript. Obviously you can execute code directly or declare functions/classes.
Sent from Mail for Windows 10
--
You received this message because you are subscribed to the Google Groups "CefSharp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp.
For more options, visit https://groups.google.com/d/optout.
browser.ExecuteScriptAsync("$('#submit-wager').trigger('click')");