<ul class="myList clearfix" id="thismyList">
<li class="myBullet" id="answer1">blabla1</li>
<li class="myBullet" id="answer2">blabla2</li>
<li class="myBullet" id="answer3">blabla3</li>
</ul>
In this page, how can I automatically click item blabla2
?
The shortest and most powerful is probably the XPath way (btw - it's one of the few w3 specifications that are actually a very good and helpful read). You can have almost any conditions you want to have.
evaluate()
,click()
See this doc to know more about XPath in JavaScript.
The non-XPath way would be to go through all the nodes manually and search for the first one containing the right text: