p5.locator("//div[contains(@class, 'flex flex-row')]/*[not(contains(@/*, 'flex flex-row')
and contains(@class, 'MuiSvgIcon-root'))]").nth(1).click()
The above example doesn’t work for me.
My workaround - loop thru all cards, if card contains an html element you want to avoid - continue, else: click and close the loop:
for card in p5.locator("xpath=//div//p[contains(text(),'$')]/../div").all():
if 'data-testid="deal-card-lock-icon"' in card.inner_html():
continue
else:
card.click()
break