How to get Coordinates any point whenever I click on browser with selenium python

8 views
Skip to first unread message

Anh Tuấn Nguyễn

unread,
Jul 30, 2023, 11:51:46 PM7/30/23
to Selenium Users
0

I use selenium python, and i want to get Coordinates whenever i click any point this is my code, anybody help me, how to get result in python

result = driver.execute_script(""" function clickHandler(e) { console.log(e) var clickCoordinates = e.clientX + ',' + e.clientY; console.log(clickCoordinates) return clickCoordinates } document.addEventListener('click', clickHandler); """) print(result)

I want to print clickCoordinates whenever click eventCapture.PNG

Reply all
Reply to author
Forward
0 new messages