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

125
Visualizações
Find all elements with a specific CSS property

I'm using Selenium to find elements in a webpage that contain the CSS property overflow-y: scroll or overflow-y: auto. Currently, I'm using the following code:

element = driver.find_element_by_xpath(
                "//*[contains(@style,'overflow-y: scroll')] | //*[contains(@style,'overflow-y: auto')]")

This will find me all the elements that have a style attribute with vertical overflow set to scroll/auto.

However, this won't find me elements that have this attribute set in their external CSS. To solve this, the first and rather naive solution that has come to my mind is to iterate over the DOM and check each element's CSS. Does anyone know a faster solution, possibly with Xpaths?

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