I am working on a web scraper in C# where I have a web browser control that loads a web page, I then collect data and depending on the data also acting on it. My problem is that I need to write some data to a input (textbox) that has listeners. The input control never shows a value in the html, it is handled by some Javascript that is fired from events on the control. I can set a value to the controls value parameter but it is as it is missing when I click OK on the form.
我已经在网上搜索了好几天,现在我知道如何从 C# 调用 Javascript,但这是我无法理解的输入上的 Javascript 函数。
输入控件如下所示:
<div id="size_1" class="incrementControl" style="width: 68px;">
<input id="size_1-input" class="hasListeners" maxlength="6" tabindex="103" value="" style="width:52px">
<a id="size_1-up" class="up hasListeners" style="left:52px" href="javascript:void(0)"> </a>
<a id="size_1-down" class="down hasListeners" style="left:52px" href="javascript:void(0)"> </a>
</div>
输入控制事件keyup、keydown、change、keypress和blur都调用这个Javascript:
function (a)
{
return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.dispatch.apply(i.elem, arguments) : b;
}
我尝试过调用不同的事件,例如 onClick 并以编程方式单击控件,但没有任何效果?!我不知道如何调用这个 Javascript 函数,因为它没有名称,也不知道要作为参数传递什么?
非常感谢任何帮助或想法!
您可以使用Watin http://watin.org/。它支持Web浏览器控件和Internet Explorer。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)