What do you mean you had to change it to use Google?
Good job!
That's not the optimal method, but if it works it's good enough for now.
The problem with it is that this method gathers all elements whose name is 'button' into an array and then presents the very first one (element [0]
). This is undesirably fragile.
I think this will work, but it's hard to tell for certain without testing.
(() => {
document.querySelector('div.btn.btn-primary.pull-right.text-uppercase').click()
})();
What does this mean? "In Google"...
Do you mean the Google Chrome web browser?
You can't right-click macros and select try-it – do you mean the JavaScript actions in the macro?
Yes there are a number of such actions:
I gather you're working in Google Chrome – yes?
You need a Google Chrome specific macro group if you don't have one.
You also need to familiarize yourself with the hotkey trigger if you haven't arleady.
For your macro you need to:
- Open the requisite URL.
- Pause until the log-in dialog is available.
- Fill out and submit the log-in dialog.
- Pause until the NEXT dialog is available.
This is a fairly complicated process, and there is more than one way to accomplish it.
The most organic if not the easiest is to use JavaScript.
You already have working code for the dialogs, but you need to be able to wait until the requisite elements are available before trying to act on them.
Here's a method for doing that: