I am trying to select a div
with a class
attribute that contains multiple spaces and new line. Here is a fragment below. I want to select all div with test-one
and topit
of what it looks like:
<div class="test-one
topit
">
<div class='test-one a'>1
</div>
<div class='topit'>2
</div>
</div>
<div class="test-one
topit
">
<div class='test-one a'>1
</div>
<div class='topit'>2
</div>
</div>
Here is what i have tried:
"//div[contains(concat(' ', normalize-space(@class), ' '), ' topranks ') and contains(concat(' ', normalize-space(@class), ' ), ' list-node ')]"
and
//*[contains(concat(' ', normalize-space(@class), ' '), ' atag ')]
Sources i have tried to improve on:
XPath - How to select by @text that contains new line
and
How can I match on an attribute that contains a certain string?