Skip to content

Instantly share code, notes, and snippets.

@sysnucleus
Created May 14, 2022 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sysnucleus/c42e4dfa678c76c392b2d53997f52b49 to your computer and use it in GitHub Desktop.
Save sysnucleus/c42e4dfa678c76c392b2d53997f52b49 to your computer and use it in GitHub Desktop.
WebHarvy Codes for Google Maps Scraping
// 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