How can I click a <li> item with Greasemonkey?
问题 <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 ? 回答1: 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. var xresult = document.evaluate("//*