I have an element with the following styles
<ul class="textboxlist-bits" style="background-color: transparent;">
Now I want to select the element based on the style attribute.
The css selector ul [style="background-color: transparent;"]
does not work there.
Kindly suggest an appropriate selector to identify such element.
I think you only have to remove the first space:
ul[style="background-color: transparent;"]
Now it is searching all ul
-tags which have this style; with the space between it tries to select all dom elements in(!) a ul
-tag which have this sytle.
Here an example with the querySelector for javascript, it should work with selenium too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With