Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
selenium unable to get CORRECT location of anchor in paragraph

First person to answer this (I don't believe there is an answer) gets a free dinner!

I am trying to locate the coordinates of a link (text) in a paragraph to move the mouse to that link to perform a hardware click (not a javascript click or click via selenium).

<p>for full automatic work you need to read about <code>DesiredCapabilities</code> as this: <a href="https://stackoverflow.com/questions/23510816/how-to-handle-downloading-a-file-in-selenium-webdriver">How to handle downloading a file in selenium webdriver?</a></p>

Doesn't matter really, the coordinates returned are always that of the enclosing <p>

Look here: https://sqa.stackexchange.com/questions/2197/how-to-download-a-file-using-seleniums-webdriver

To see the above code on page, look for the text How to handle downloading a file in selenium webdriver?

Inspect it, play around with it, no matter how I try to get at the anchor location, I can't seem to find a way to get to it. It's always the paragraph bounding rectangle.

Inspecting in Firefox it will highlight the text (but how to get to that programmatically?)

Seleniun 'finds' the anchor fine, i've tried by text, xpath, css, all find the same tag, inside the <p> and all return the x,y of the <p>.

I've tried a range to count words and calculate the position, but getting the text returns the text of the anchor, not the enclosing paragraph.

thanks in advance!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda