Capturing an element value on a web page using element coordinates

I have the coordinates (x, y) of an element in a webpage. How to get the value stored in this element in this position. More specifically, I want to capture the value that appears on the web page in that particular place.

Is there a way to do this with Selenium Python bindings?

+4
source share
1 answer

Run javascript code and get the element with elementFromPoint():

x = 100 
y = 100
element = driver.execute_script('return document.elementFromPoint({x}, {y});'.format(x=x, y=y)
+2
source

Source: https://habr.com/ru/post/1567990/


All Articles