[Python] How to get screen coordinate of a element in selenium? [Python]

Discussão em 'Python' iniciado por Stack, Junho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I wanted to know that how can one get the coordinates of a element according to the screen resolution rather than the browser windows size, I have tried this already (code block), but it provides coordinates according to the browser window rather than the screen

    element = driver.find_element_by_xpath("//*[@id='search_form_input_homepage']")
    print(element.location)


    Any alternatives that I can use?

    A terrible attempt to explain what I mean :

    note: driver.execute_script is not allowed, as the website has a bot blocker :( [​IMG]

    Continue reading...

Compartilhe esta Página