-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeUndetected Chromedriver Mode / CDP ModequestionSomeone is looking for answersSomeone is looking for answers
Description
Hi, I can't figure out how I could use/select/click second element if it have same selector as first one ,per example:
<div>
*shadow dom*
<button>No</button>
<button>Yes</button>
</div>
if I use just click it's always pick up first element:
with SB(uc=True, test=True, incognito=True, locale_code="en") as sb:
sb.click("div::shadow button")
if I use find_elements it's not work with ::shadow selector
with SB(uc=True, test=True, incognito=True, locale_code="en") as sb:
sb.find_elements("div::shadow button") # {"status":32,"value":"An invalid or illegal selector was specified"}
I also tried to select by text but it's also don't work, probably because there also shadow dom in buttons along with text
with SB(uc=True, test=True, incognito=True, locale_code="en") as sb:
sb.find_elements("div::shadow button[text(), "Yes"]") # don't find element, not sure if syntax right here, I take it from selenium
Can't find something that could help in docs, please help.
Metadata
Metadata
Assignees
Labels
UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeUndetected Chromedriver Mode / CDP ModequestionSomeone is looking for answersSomeone is looking for answers