![]() ![]() |
Hello - First time script writer, long time Greasemonkey lover and I have a question already... I am trying to modify the script below to click a button that looks like this on a site: <button>check price</button> I am using this template... so far the page seems to keep reloading... nothing else happening. Any advice to someone new? Thanks! (function() {
|
![]() ![]() |
Does this work? function clickConfirmButton(e) {
var buttons = document.getElementsByTagName('button');
var clicked = false;
for (var index=0; index < buttons.length; index++){
if(buttons[index].textContent == "check price"){
buttons[index].click();
clicked = true;
break;
}
}
if(!clicked){
setTimeout("window.location.reload()",300*1000);
}
}
clickConfirmButton();
Main change is from button.value to button.textContent. |


