Created
May 13, 2022 07:12
-
-
Save sysnucleus/c6cfd2fa5b661d01ffafdcc59561e807 to your computer and use it in GitHub Desktop.
Instagram WebHarvy Scraping Codes
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
// RegEx to get post URL | |
href="(\/p\/[^\/]*\/) | |
// JavaScript code for pagination | |
els = document.getElementsByTagName('svg'); | |
for (var i = els.length - 1; i >= 0; i--) { | |
attr = els[i].getAttribute('aria-label'); | |
if(attr && attr === "Next") { | |
els[i].parentElement.click(); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment