I have a snippet where I want to automatically click a submit button after entering the text. I have solved this in such a way that I first execute the Tab key for this and then a left mouse click. So far, this has also worked perfectly.
Now, however, the web page has changed and another button occasionally appears before the submit button. This then causes the wrong button to be clicked. Is there a way to specify a specific Submit-button to click for this case? Unfortunately, I can no longer work with the tab key in this case.
Unfortunately there is no way to click on specific elements. We may add this functionality down the road. Just to confirm, the specific Submit button is not reachable via keyboard actions? such as Shift-Tab, Tab, etc.? If you can give me more details about the website, I can also check this myself.
I would also love to be able to select a specific button. In my case, I want to click a button, but the button can be in a different place sometimes (just like @Kamuro). I use the "if,elseif,else" commands to use different amounts of "shift tabs" in different cases. If this website changes its interface, I have to change all my snippets as well. It would be a lot easier to be able to select the button without the key presses. @Gaurang_Tandon has anything changed in the recent updates? @Kamuro Maybe you can also use the if/else commands
If the site selector is not the same, then what is the relation between the buttons? Do they all look the same visually?
It seems you are using this snippet on Facebook. Can you tell which Facebook buttons you are referring to? It would be helpful to understand this better.
We work with Sprout Social, which collects all reactions on all channels into one inbox. In other words: our Facebook, Instagram, Tiktok and Youtube replies are all collected into one "feed".
The order of the buttons does not change, there's just more/less selectable buttons depending on the channel. As you can see in my snippet, I need 5 shift tabs for Facebook and 4 for the other channels. Furthermore, the snippet "ignores" Facebook threads (which is the first part of the "if" command, with the note "this does nothing").
This is what the button looks like (circled in red). The selectable parts are highlighted in yellow:
add the "Website" command with "contents HTML" selected into your snippet.
use the "Select from website" button to generate to select your target button in the first layout.
now, run the snippet and check the output that you got.
now, change the layout (so the number of shift-tabs changes), and run the snippet again.
If you get the same HTML output on running the snippet again, that means the site selector is consistently selecting the same button on every rerun. Let me know if it works for you.
Thank you! I will check back after my holiday, must say that this is quite advanced for me already. Please tell me:
Where should the command be, does that matter? Can you tell me what my snippet should look like?
What should I do in step 2 exactly?
What do you mean by layout? Do I need to change the snippet to test this, or change the situation (so: reply to FB comment first, check the output, then do the same for a different comment that needs less shift-tabs)?
thank you for your help. Unfortunately, I haven't quite understood this yet either. So I ran the "site selector" and identified the button on the page. The result was then a {site: html; selector=.button-send}.
How does it go on then? I pasted the code into the snippet and then gets an HTML code that produces the send-button when using the snippet.
Hi @Kamuro , my post was a not a suggestion, but just a discussion about adding a new command potentially. That command, would click on the button using its selector (like the one you have - .button-send). See this post for more discussion on this topic: Placer, a companion function to Selector
Unfortunately, however, the {placefocus: selector=.button-send} statement does not work. This is only entered as HTML text, but the button is not selected.
Bookmarked and following for, hopefully, an eventual solution as well. My work is done on an internal webpage and automating a couple of forms would be amazing, but not unless I can click some buttons that are not reachable through key clicks (tab, shift-tab) at various points in the automation.