window.onload = function() {
var links = document.getElementsByTagName("a");
var num = 0;
for (var i = 0; i < links.length; i++) {
var link = links[i].getAttribute('href');
if (link.indexOf('word') !== -1) {
num++;
links[i].click();
if(num == 2) break;
}
}
}