09-18-2014, 12:49 PM
Macro Macro2433
out
;this macro clicks all span elements containing text "apple"
lpstr keyword = "apple"
int IEFrame = win("" "IEFrame")
Htm eSpan eParent
eParent=htm("BODY" "" "" IEFrame)
MSHTML.IHTMLElement2 e2=+eParent.el
foreach eSpan.el e2.getElementsByTagName("span")
,str s=eSpan.Text
,out s
,if find(s keyword 0 1)>=0
,,out "keyword found"
,,;eSpan.Click
,,eSpan.Mouse(1)
,,wait 0.5