Search code examples
c#.netwebkit.net

How to get HTML form data opened in Webkit.Net



I have a HTML5 page loaded in Webkit.Net. Now, I am trying to get the data enetered by user on HTML page.
I am trying the following code:
WebKit.DOM.Document doc1 = webKitBrowser1.Document;
WebKit.DOM.Element name1 = doc1.GetElementById("email");
string test1 = name1.GetAttribute("value");

The code is not working. Value of email element is not coming in test1.
Am I missing something? Do anyone know any workaround or any other method to do this?


Solution

  • This is pretty much a duplicate of Get HTML input text value in webkit

    The solution is

    String test1 = webKitBrowser1.StringByEvaluatingJavaScriptFromString("document.getElementById('email').value");