摘要: 4. 给定限定条件你也可以使用正则表达式,不过注意设置开关打开:
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
oDesc( "text" ).value = "I.*age.*"
oDesc( "text" ).regularExpr ...
4. 给定限定条件你也可以使用正则表达式,不过注意设置开关打开:
|
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
oDesc( "text" ).value = "I.*age.*"
oDesc( "text" ).regularExpression = True
注意:默认情况下正则表达式的开关是打开的
如果你这里正则表达式的开关设置成为了false,那么你查找到的是text属性为“I.*age.*”的link。
5. 注意某些description的成员设置属性值时,需要使用整型数,而非字符串。
Dim oDesc
Dim colObject
Set oDesc = Description.Create
oDesc( "micclass" ).value = "Link"
oDesc( "x" ).value = 51
Set colObject = Browser( "title:=Google").Page("title:=Google").ChildObjects( oDesc )
MsgBox colObject.Count
For x = 0 to colObject.Count - 1
MsgBox colObject(x).GetROProperty("innertext")
Next
6. 限定条件可以参数化
Dim x
X=56
Browser("creationtime:="&x).Page("micclass:=Page").WebEdit("name:=q").Set "Description.Create"