Last active
October 22, 2021 11:19
-
-
Save pocesar/3af3d73479c8f67a234f30e40ffcd41e to your computer and use it in GitHub Desktop.
Revisions
-
pocesar revised this gist
Aug 9, 2018 . No changes.There are no files selected for viewing
-
pocesar created this gist
Aug 9, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ (async function walk() { const waiter = (time) => (new Promise((resolve, reject) => { setTimeout(resolve, time) })) const photo = document.querySelector('._3-8h._50zy._50-0._50z_._5upp._42ft') const okBtn = '.uiOverlayFooter ._4jy0._4jy3._4jy1._51sy.selected._42ft' if (photo) { photo.click() let l = 1 while (true) { await waiter(1000 * l++) let k = document.querySelector(okBtn) if (k) { k.click() while (document.querySelector(okBtn)) { await waiter(100) } break } } } else { return alert('done?'); } setTimeout(walk, 1000); })()