$(".grid-coupon-clip-button button").click();
$(".grid-coupon-clip-button button").click();
The mental effort of going to the site at all was what I was trying to circumvent - now I don't even need to think about it (the clearer abstraction is that going from "2 to 1" is a much less drastic jump than going from "1 to 0" - completely removing the overhead is what makes this worthwhile, IMO, not the actual speed of the actions)
https://gist.github.com/pbojinov/d572b5494a4f26390aeb5136d70...
https://www.safeway.com/justforu/coupons-deals.html
for(let i=0;30>i;++i)setTimeout(function(){btn=document.querySelector("#coupon-grid_0 > div.coupon-grid-container > div.load-more-container > button");btn && btn.click()},1e3i);elems=document.querySelectorAll(".grid-coupon-clip-button button");for(let i=0;i<elems.length;++i)setTimeout(function(){elems[a].click()},500i);
Rube Goldberg Machine's are not good in software projects...
Though of course if Safeway's website does have a global `$` from jquery then that would take precedence.
> what does this do exactly?
The command allows you to click all buttons in the page at once:
• The dollar sign is an alias for jQuery [1];
• The text between double quotes is a CSS selector;
• Select every DOM element with a “grid-coupon-clip-button” and “button” CSS class;
• The thing at the end is a JavaScript function call which triggers an “onclick” event [2];
- Select every button with a parent element that has the css class “grid-coupon-clip-button”