Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
htm text find next ..
#1
I would like to create a macro in the following way.

1. If 1line find the text "apple"
2. 1line text name Click
3. if next 2line text name"apple" 1line non click 2line Click
..
..
...
if not found
out "not found"


Code:
Copy      Help
lpstr keyword = "apple"
int IEFrame = win("" "IEFrame")
Htm e=htm("SPAN" keyword "" IEFrame)


Help
#2
Macro Macro2433
Code:
Copy      Help
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
#3
It's amazing thank you very much . Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)