mshtml.IHTMLDocument2 中的mshtml.IHTMLDivElement问题请教
校内网站.学习代码中,抓取个html页面.然后模拟登录.其他都没问题了.只是html页面中如下
<td>
<div id="验证码1"></div>
</td>
<td>
<div id="验证码2"></div>
</td>
这两个验证码1和验证码2,是要给值的,然后按了提交按钮后,提交给下一个页面
他采取了这种方式,然后我想
mshtml.IHTMLDocument2 htmlDoc = ie.Document as mshtml.IHTMLDocument2;
mshtml.IHTMLDivElement useryzm = (mshtml.IHTMLDivElement)htmlDoc.all.item("验证码1", 0);
mshtml.IHTMLDivElement useryzm2 = (mshtml.IHTMLDivElement)htmlDoc.all.item("验证码2", 0);
这样后,useryzm和useryzm2就没法赋值了.想像mshtml.IHTMLInputElement aa一样.调用了后,然后用aa.value给赋值
如果mshtml.IHTMLInputElement useryzm = (mshtml.IHTMLInputElement)htmlDoc.all.item("验证码1", 0);
就会报错...
我想给这两个div中的id赋值,怎么做呢?
恳请各位大大赐教~