浏览器控件中,获取页面元素信息的功能失效。返回值为空
代码如下:
weblogin = "http://192.168.1.1/"
Do While 1
Htmlloaded = 0
Form2.WebBrowser1.Url = weblogin //打开指定网页功能正常
For 10
If Htmlloaded = 1 Then
titleurl = Form2.WebBrowser1.GetTitle //返回网页标题正常
TracePrint titleurl
Exit Do
End If
Delay 500
Next
Loop
Do While 1
Htmlloaded = 0
Call Form2.WebBrowser1.RunJS(0,"javascript:switch_interface_type('mobile','/cgi-bin/turbo/admin_mobile');")
For 8
If Htmlloaded = 1 Then
numurl = Form2.WebBrowser1.HtmlExists("id:input_password_login")//获取指定元素特征串个数返回1,功能正常
If numurl <> 0 Then
TracePrint numurl
Exit Do
End If
End If
Delay 500
Next
TracePrint numurl
Loop
starttime1F18 = wqmclk_Ags2
Do While 1
Htmlloaded = 0
Call Form2.WebBrowser1.HtmlInput("12345678","id:input_password_login")//在输入框中填写字符串功能正常
For 10
If Htmlloaded = 1 Then
txturl = Form2.WebBrowser1.HtmlGet("value", "id:input_password_login")
//*****读取输入框内的输入值,返回值为空,功能失效(同样功能在WQM浏览器插件上正常)*****
If Strcomp(txturl, "12345678") = 0 Then
TracePrint txturl
Exit Do
End If
End If
Delay 200
Next
TracePrint txturl
Loop
Event Form2.WebBrowser1.DocumentComplete
Htmlloaded = 1
End Event