Created
July 29, 2019 05:52
-
-
Save lamchau/c4ce1c9ff726bba6d6a40d0a8958858c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$asArray = selector => Array.from(document.querySelectorAll(selector)); | |
loadMore = setInterval(() => { | |
const clickButton = ($x, index) => setTimeout(() => $x.click(), index * 25); | |
const $more = $asArray('.load-more'); | |
if ($more.length) { | |
$more.forEach(clickButton); | |
return; | |
} | |
clearInterval(loadMore); | |
$asArray('.grid-coupon-btn').forEach(clickButton); | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment