0
我想通过ID来获得元素设置的属性值,然后获得属性,等等....获取和元素awesomium在C#
在Web浏览器中,我从这个代码中使用:
HtmlElement element = wb.Document.Body.Document.GetElementById("dnn_ctr730_ViewTMUrbanFileStatusFromWebService_fb_Captcha_CaptchaImageUP");
if (element != null)
{
string link = element.GetAttribute("src");
但是在awesomium中我该怎么做?
而且当我想从这个代码中使用的网络浏览器的值设置为元素:
wb.Document.GetElementById("txtFileNo").SetAttribute("Value", "12345");
wb.Document.GetElementById("BTN").InvokeMember("click");
,但我不知道我可以在awesomium做到这一点....
我发现设定值验证码:
dynamic document = (JSObject)webctrl.ExecuteJavascriptWithResult("document");
if (document == null)
return "";
using (document)
{
dynamic elem = document.getElementById("txt1");
if (elem == null)
return "";
using (elem)
elem.value = "test";
,但我不知道如何调用点击,以及如何获得属性值...
anye one can help me ..?
亲切的问候
感谢您的信息,一切正常,但只提交代码'“$(BTN).trigger('click');”'不适合我!你可以给我更多的解决方案吗?亲切的问候 – Sam
:我也使用这些代码:'动态元素=(JSObject)webctrl.ExecuteJavascriptWithResult(“document.getElementById('btn')”);如果(element!= null) element.Invoke(“click”); element.Invoke(“submit”); }'但是不能工作...... – Sam
哎呀,忘了使用'#'选择器来通过id获取元素... –