jamietre / CsQuery

CsQuery is a complete CSS selector engine, HTML parser, and jQuery port for C# and .NET 4.
Other
1.16k stars 249 forks source link

Is there an element.click() #181

Open brendonco opened 9 years ago

brendonco commented 9 years ago

Hi,

Is there an element.click() ?

e.g. CQ dom = CQ.Create(HTML); dom["#myelementbutton"].click();

If yes, how to implement an element click?

tellez12 commented 9 years ago

There is not an click event, remember you are not executing the javascript. What are you exactly trying to do with the click?

brendonco commented 9 years ago

I'm trying to execute a JS function inside the JavaScript file similar to JQuery click(). If it not possible with CQ, do you have a better idea in mind?

rondefreitas commented 9 years ago

CsQuery is really a tool for manipulating and parsing HTML using similar syntax as the jQuery library. "click" events and the like aren't really applicable in that sense.

like @tellez12 said, "you are not executing the javascript".

If you're trying to do unit testing of your javascript, use Jasmine. If you're trying to have server-side code trigger an event in javascript, use SignalR.

If there's something else you're trying to accomplish, please explain.

radenkozec commented 9 years ago

I also need this functionality to automate form filling and submission. JQuery also has form.submit

jamietre commented 9 years ago

Once again: CsQuery is NOT a javascript engine. It does not run javascript. It is an HTML parser. It has no knowledge of DOM events.

brendonco commented 9 years ago

Thanks for highlighting the use of CSQuery.