Is there a way to automatically click on a button that appears on a web page only after another button has been clicked? I have successfully automated the first click, but I am struggling with automating the second click once the button appears.
The code below works when I manually run it in the console after the button appears:
// ==UserScript==
// @name Soundplate SUBMIT MUSIC Button
// @include https://play.soundplate.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @grant GM_addStyle
// ==/UserScript==
var TargetLink = $("a:contains('SUBMIT MUSIC')")
if (TargetLink.length)
window.location.href = TargetLink[0].href
I am unsure how to trigger this code automatically after the initial click. I have heard of waitForKeyElements as a possible solution, but I am not sure how to implement it in this scenario. Any guidance or advice would be greatly appreciated.