Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleep(ms)
- {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
- function removeElementsByClass(className)
- {
- var elements = document.getElementsByClassName(className);
- while(elements.length > 0)
- {
- elements[0].parentNode.removeChild(elements[0]);
- }
- }
- async function coupon()
- {
- await sleep(5000);
- removeElementsByClass('hidden');
- var coupons = document.getElementsByClassName("vpc_clip_section");
- console.log(coupons);
- for (var i = 0; i < coupons.length; i++)
- {
- var c = coupons[i];
- console.log(c.innerText);
- if(c.innerText.substring(0,1) == 'S')
- {
- await sleep(2000);
- c.childNodes[1].click();
- }
- }
- }
- coupon();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement