Created
November 18, 2018 09:13
-
-
Save edubey/d767bbbdb2c16c42c558800c3e9c2d7b to your computer and use it in GitHub Desktop.
Scrap Multiple Story from a Publisher Page
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
var i = 0, | |
maxCount = 5; | |
var storyInterval = setInterval(() => { | |
document.querySelectorAll(".js-trackedPost>a")[i].click() | |
setTimeout(() => { | |
console.log("Title : ", document.getElementsByClassName("graf--title")[i].innerText); | |
p = document.getElementsByClassName("ui-xs-clamp2")[0] | |
console.log("Profile Description : ", p ? p.innerText : ""); | |
history.back() | |
}, 2000); | |
i++; | |
if (i == maxCount) clearInterval(storyInterval); | |
}, 8000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment