简体   繁体   中英

c# javascript in browser

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/ut55cfdvg5wgj/ ?

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM