Created
October 20, 2021 19:22
-
-
Save XCaminhante/bbe7892377a4b17ad53bff7e76b913ce to your computer and use it in GitHub Desktop.
Iterar itens no Facebook Marketplace (interface touch.facebook.com)
This file contains 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
// Itens no Marketplace Touch | |
function xpathQuery (query, parent) { | |
var i = document.evaluate(query, parent, null, XPathResult.ANY_TYPE, null); var a = []; | |
do { var b = i.iterateNext(); if (b==null) {break;}; a.push(b); } while (true); return a; | |
} | |
function clickItems (x) { if (x.length) { x.shift().click(); setTimeout( clickItems.bind(null,x ), 5 ); } } | |
var a = xpathQuery('//div[@class="_a58 _9_7 _2rgt _1j-g _2rgt"]/img',document); a.shift(); clickItems(a); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment