Chrome console auto click button by text

Chrome console auto click button by text



I have a local javascript in Firefox/Chrome that generates a family tree. It has a button that is auto generated and each instance of the button has an incremented id from the one previous.


Firefox/Chrome


button id="family376" onclick="generateFamily(376)" title="Get Family"
style="display: none;">Family</button>



Which calls this:


function onclick(event)
generateFamily(376)



If I click this button it disappears and generates children that also have the chances to have a Family button.


Family



The following code works up to a point but I need to set a delay instead of pressing them all at once. It only takes about five generations to lock up the tab its running in.


javascript:document.querySelectorAll('button[id^="family"]:not([style])').forEach(function(ele) ele.click())



This next code I believe I actually found here but obviously doesn't work. It needs an int instead of the button title I believe, which I can't provide. I also have to be careful about the fact that the buttons are hidden after clicked and not actually removed.


javascript: (function($) $(document).ready(function() setInterval(function() $(‘family’').click(); , 0.1) ); )(jQuery);



I also tried using xpath, but once again the buttons are enumerated incrementally.


//*[@id="family376"]



I've tried writing code that increments the id but have no idea how to concatenate with js.



So, my actual question is? How do I auto-click visible buttons with title="Get Family with a small delay between each click.


title="Get Family






Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

Node.js puppeteer - Use values from array in a loop to cycle through pages