Created
May 14, 2022 14:41
-
-
Save sysnucleus/c42e4dfa678c76c392b2d53997f52b49 to your computer and use it in GitHub Desktop.
WebHarvy Codes for Google Maps Scraping
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 for Phone | |
(\d{3}[-\.])?(\d{3}[-\.]\d{4})|(\(\d{3}\) ?\d{3}-\d{4}) | |
// RegEx for Website | |
([-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)) | |
// JavaScript code to scroll | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function scrollList() { | |
list = document.getElementsByClassName('m6QErb DxyBCb kA9KIf dS8AEf ecceSd')[0].children[0]; | |
for (var i = 0; i < list.childElementCount; i++) { | |
list.children[i].scrollIntoView(); | |
await sleep(100); | |
} | |
} | |
scrollList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment