Somehow I would like to search directly for some text? Is that possible using querySelector?
Dom :
<div class="div1">
<span class="text">
<span> text to search </span>
</span>
</div>
I have tried the following without success.
JS Code: document.querySelector('div[contains("text to")]')
= FAIL
I know the easy way something like: document.querySelector('span.text > span')
My example is kept simple, I know that. I am looking for a solution similar to selenium selenium driver.find_element_by_link_text
I want to independently search for an element without relying on the class or id, any ideas?