Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
find text expression on web page and get X Y coordinates of its location
#2
Don't know if this is the best method.
Open firefox on this page, the code below interacts with your name (blue link: johnguo).


Macro Macro60
Code:
Copy      Help
;Below example only works for firefox.


int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
FFNode f.FindFF(w "A" "johnguo" "" 0x1001)
Acc a.FromFFNode(f)
int x y
a.Location(x y)
out F"x:{x} , y:{y}"

;Activate the below code to test it out (do not activate all at the same time, test one by one).

;; To click on link, method 1
;a.DoDefaultAction

;; To click on link, method 2
;a.Mouse(1)

;; To move mouse to link
;a.Mouse(0)

;; Output href (url-link)
;out f.Attribute("href")


;(Firefox!) To get the above code:
;1. Go to: \System\Functions\Control\FFNode\FFNode help
;;;;Or put the cursor within the double quotes of the following and then press [F2]: "FFNode help"
;2. Used the example in "FFNode help"
;3. Then defined accisble objects 'Acc a' then used memberfunction 'FromFFNode'
;;;;This means type 'Acc a' immediatley followed by a dot and then list of memberfunctions will show.

;(Firefox!) Alternative:
;1. In the top right on the floating toolbar click 'Windows, controls'
;2. Select "Accessible object actions"
;3. In the dialog that pops up above top left, drag the 'Drag' icon over an object, for example a link
;4. In the left select 'Get location' and then on the right side select 'X' and 'Y'
;5. Then press 'Ok', code will be pasted


Messages In This Thread
RE: find text expression on web page and get X Y coordinates of its location - by r0n - 10-17-2018, 11:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)