简体   繁体   English

c# javascript 在浏览器中

[英]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/ ?可在此处找到按钮示例: 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.我可以使用 firebug 在 firefox 中使用 javascript 摆脱它,但是当我在 c# 中使用浏览器控件尝试相同的脚本时,它不起作用。

The script is:脚本是:

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

Any help would be nice.你能帮忙的话,我会很高兴。

.click would refer to the corresponding event, try; .click会引用相应的事件,试试;

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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