For my work I have to claim the "leads" on my company's portal that meets certain criteria. A snippet of the portal is shown below.
I like to write a code that automatically claims the leads that meet those requirements (for instance let's say the lead source is in this case *Too Lazy To Ask) as soon as it becomes available.
Right now, I have written a code using jQuery library (run through Tampermonkey extension) that refreshes the portal at certain intervals and sends a notification as soon as the text *Too Lazy To Ask is found on the page but I have to go and click on the Claim button myself. But now I like to make it better and have it automatically click on the Claim button for me.
Considering that I am a complete beginner in this word, I would appreciate some guidance on how to tackle this problem.
I have also copied a section of the source code for the company's portal below:
<div class="standard">
<div>
<h2 id="ctl00_ctl00_main_main_viewingHeader">Lead Bucket</h2>
</div>
<span id="ctl00_ctl00_main_main_pager1">
<table cellpadding="5px" class="pagerTable">
<tr class="pager">
<td class="previous"></td>
<td class="next"></td>
<td class="count">
<span>1-1 of 1</span>
</td>
</tr>
</table>
</span>
<span id="ctl00_ctl00_main_main_lblMessage" style="color:Black;font-weight:normal;font-style:italic;">Page refreshes every 2 mins.</span>
<table class="grid borderTop" cellpadding="0px" cellspacing="1px">
<tr class="listItem1">
<div>
<table class="listItem1" cellpadding="0px" cellspacing="0px">
<tr>
<td>
<a href="ViewLead.aspx?isLead=true&AutoLeadID=981039530" alt="View Lead">Dealer Test Test2</a>
</td>
<td><label>2/4/21</label></td>
<td class="green">0 Hrs Old</td>
</tr>
<tr>
<td colspan="2"></td>
<td>*Too Lazy To Ask </td>
</tr>
<tr>
<td>
<input type="submit" name="ctl00$ctl00$main$main$rpt$ctl01$btnClaim" value="Claim" id="ctl00_ctl00_main_main_rpt_ctl01_btnClaim" />
</td>
<td colspan="2">Iddm Leads</td>
</tr>
</table>
</div>
</tr>
</table>
<span id="ctl00_ctl00_main_main_pager2">
<table cellpadding="5px" class="pagerTable">
<tr class="pager">
<td class="previous"></td>
<td class="next"></td>
<td class="count">
<span>1-1 of 1</span>
</td>
</tr>
</table>
</span>
<span id="ctl00_ctl00_main_main_Timer1" style="visibility:hidden;display:none;"></span>
</div>
<div style="text-align: right;">
<a href="../../LogOut.aspx" id="ctl00_ctl00_aLogOut">Log Out</a>
</div>
<script type="text/javascript">
//<![CDATA[
Sys.Application.add_init(function() {
$create(Sys.UI._Timer, {"enabled":true,"interval":120000,"uniqueID":"ctl00$ctl00$main$main$Timer1"}, null, null, $get("ctl00_ctl00_main_main_Timer1"));
});
//]]>
</script>
question from:
https://stackoverflow.com/questions/66054736/find-the-click-id-of-a-certain-button-in-jquery 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…