Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
just have a simple question. How can I click a button in Webkit?

I have this code for the normal webbrowser:
HtmlDocument document = webBrowser1.Document;
        document.GetElementById("id").InvokeMember("click");

How does this work for Webkit and I have also this one, which doesn't work either:

HtmlElementCollection classButton = webBrowser1.Document.All;
        foreach (HtmlElement element in classButton)
        {
            if (element.GetAttribute("class") == "bla")
            {
                element.InvokeMember("click");
            }
        }

Thanks for help


Edit: I have found this: [^]

But how do I use it?
Posted
Updated 3-Jun-16 13:08pm
v3
Comments
joginder-banger 12-Dec-13 12:10pm    
share more information what you try ?
Kusatsu 12-Dec-13 16:15pm    
I just want to click on a button, but it doesn't work with the command, which you use in the normal webbrowser.
So I want to know which code I have to use instead of InvokeMember
creepz03 12-Dec-13 20:17pm    
Does it have any error? On which line does it occur?
Kusatsu 13-Dec-13 7:53am    
I get this error (sry, I have visual studio in german)
Eine implizite Konvertierung vom Typ "WebKit.DOM.Document" in "System.Windows.Forms.HtmlDocument" ist nicht möglich.

That means that he can't convert WebKit.DOM.Document to System.Windows.Forms.HtmlDocument, this error occurs in this line:
HtmlDocument document = webKitBrowser1.Document;
Gaurav Makwana 14-Dec-13 5:17am    
just check your click event property and write same event

1 solution

geckoWebBrowser1.Navigate("javascript:void( document.getElementById( 'Id' ).click() ) ");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900