|
为了和robot中代码兼容,修改以上代码
Function FindSucessString(byval url as string, byval strFind as String) as integer
Dim ie as SHDocVw.InternetExplorer
Dim Doc as MSHTML.HTMLDocument
Dim td as MSHTML.HTMLBody
Dim tbl as MSHTML.HTMLTable
Dim r as MSHTML.HTMLTableRow
Dim c as MSHTML.HTMLTableCell
Dim i as integer
set IE = New SHDocVw.InternetExplorer
IE.Navigate url
Set doc = ie.document
set td = doc.body
for i = 0 to doc.all.length - 1
if UCASE(doc.all(i).tagName) ="TABLE" Then
Set tbl = doc.all(i)
for each r in tbl.rows
for each c in r.cells
if trim(c.innertext) = strFind then
FindSucessString = 1
exit Function
end if
next
next
end if
next
FindSucessString =0
Set doc =nothing
End Function
如果成功返回值为1,否则为0
经过测试我修改了table,中间如多种页面元素,比如input text等
你把以上代码修改为dl,主意要引用两个对象mshtml ,mircosoft internet control两个对象!然后编译。
然后注册该dll,再robot中引用就可以了 |
|