Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!