Thursday, December 10, 2009

Get all Objects in WebPage irrespective of Class

'Code to get all objects irrespective of Class in WebPage

'systemutil.Run "www.google.com"

Dim des,res,Obj_Name,Obj_Cls,ie,xl

Set ie=createobject("internetexplorer.application")
ie.navigate("www.google.com")
ie.visible=true

Set xl=createobject("excel.application")
xl.visible=true
xl.workbooks.add
xl.sheets("sheet1").select
xl.cells(1,1).value="Object_Class"
xl.cells(1,2).value="Object_Name"

Set des=description.Create
des("visible").value=true

Set res=browser("name:=Google").Page("title:=Google").ChildObjects(des)

Set pop=createobject("wscript.shell")
btn=pop.popup(res.count,3,"Count of Objects in WebPage")
'msgbox res.count

For i=0 to res.count-1

Obj_Cls=res(i).getroproperty("micclass")
Obj_Name=res(i).getroproperty("name")
' print "Class of the Object is: "&output&" Name of Object is: "&val

xl.cells(i+2,1).value=Obj_Cls
xl.cells(i+2,2).value=Obj_Name

Next


Set xl=nothing

Set ie=nothing



Thanks & Regards
Baba Fakruddin.D
baba.fakru@gmail.com

No comments:

There was an error in this gadget