Discussions » Development

If/then and clicking image w/ text

§
Posted: 2019-01-13
Edited: 2019-01-13

If/then and clicking image w/ text

I need help figuring this out as I've looked around google and not getting anywhere.

I need a script that looks for a specific ".jpg"

and IF it sees it then it would click the button with correct text...

This is the class ID for the buttons: "btn btn-primary btn-block"

it would click the one with the text "Thats IHOP!" and not the others like: "Thats Denny's!", "Thats Red Robins!". "Thats Arbys!"

like:

if (imageofIHOP.jpg exists) {
    document.getElementsByClass("btn btn-primary btn-block").withText("Thats IHOP!").click();
}

(of course this code wont work) but I thought it would be best to give a crappy example to help explain a bit more

Post reply

Sign in to post a reply.