开发者

c# javascript in browser

开发者 https://www.devze.com 2023-03-01 21:44 出处:网络
I am trying to automatically click on a button on a webpage. An example of the button can be found here:http://www.movshare.net/video/ut55cfdv开发者_开发百科g5wgj/?

I am trying to automatically click on a button on a webpage. An example of the button can be found here: http://www.movshare.net/video/ut55cfdv开发者_开发百科g5wgj/?

I can get rid of it with javascript in firefox usin firebug, but when I'm trying the same script in c# with the browser controll it doesn't work.

The script is:

btn = document.getElementsByName("submit"); 
btn[0].click();

Any help would be nice.


.click would refer to the corresponding event, try;

.Document.All.GetElementsByName("submit")[0].InvokeMember("click");
0

精彩评论

暂无评论...
验证码 换一张
取 消