D
D
deamix2021-12-04 19:56:59
Python
deamix, 2021-12-04 19:56:59

Is it possible to find an object by data-marker?

Can I somehow find the object I'm using selenium and click on it with the data-marker value?
Or can I find an object by the text contained in this object?

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2021-12-04
@ScriptKiddo

Find
XPath
.//*[@data-marker]

from selenium.webdriver.common.by import By
driver.find_element(By.XPATH,  xpath).click()

Find by text
//*[@data-marker and contains(text(), 'текст')]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question