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?