Tamper Monkey click the correct button

86
January 23, 2020, at 9:30 PM

So basically this will fill up with customers and I want to make a script to automatically check the first customer in the list and check what it says under Pref for that customer and click the button matching the same value (The pref text and the button values are the same). I am able to fetch the text from pref but I am unsure how I go about clicking the correct button without clicking the same button for the other customers (I want it to only click on the first customer)

Not sure if this will help but here's some HTML

<td class="middle" align="center"><br><br>
<table width="100%" cellpadding="0" cellspacing="0">
<tbody><tr>
<td width="33%" align="center">Pref</td>
<td width="33%" align="center">Action</td>
<td width="33%" align="center">Name</td>
</tr>
<tr><td colspan="3" align="center">&nbsp;</td></tr>
<tr>
<td width="33%" align="center" style="font-size:20px;">Renew</td>
<td width="33%" align="center"><form method="post" action="action.php"><input type="hidden" name="uaction" value="111832"><input type="hidden" name="tim" value="1579702105">
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Renew">&nbsp;&nbsp;
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Cancel">&nbsp;&nbsp;
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Delete">
</form></td>
</tr>
<tr><td colspan="3" align="center">&nbsp;</td></tr>
<tr>
<td width="33%" align="center" style="font-size:20px;">Renew</td>
<td width="33%" align="center"><form method="post" action="action.php"><input type="hidden" name="uaction" value="159665"><input type="hidden" name="tim" value="1579702105">
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Renew">&nbsp;&nbsp;
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Cancel">&nbsp;&nbsp;
<input class="button" type="submit" style="font-size:20px;" name="2721167877" value="Delete">
</form></td>
</tr></tbody></table></td>
READ ALSO
Multiple form loaded in view (index page) via Datatables - remote forms will not submit properly

Multiple form loaded in view (index page) via Datatables - remote forms will not submit properly

I have a Rails app with DatatablesI am trying to add a select to each row that completes a simple JS call to update the record

97
Breakpoint set but not yet bound in Visual Studio Code for a dockerized node process

Breakpoint set but not yet bound in Visual Studio Code for a dockerized node process

I am trying to use the debugger in Visual Studio Code on a macOS Catalina for a node appI created a very simple example to illustrate my case

152
setInterval keeps speeding up

setInterval keeps speeding up

New to Stack and new, more or less, to JS and React (trying to go through a free coding bootcamp)

101
Send file from server to client (browser) through socket io using socket.io-stream node package

Send file from server to client (browser) through socket io using socket.io-stream node package

I am trying to receive a file from the socket io server using socketio-stream package

154