Skip to content

Instantly share code, notes, and snippets.

@u-l-y
Last active May 13, 2021 12:13
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 u-l-y/c769624293c814ae0aafab24134ff8bb to your computer and use it in GitHub Desktop.
Save u-l-y/c769624293c814ae0aafab24134ff8bb to your computer and use it in GitHub Desktop.
Extract Emails from Gmail current page using the browser console
// Make sure you load the url that you are looking to get the emails from
// right from the beginning, so if you are looking to search something, do
// the search and then refresh to load just the data of the right url
// Example: https://mail.google.com/mail/u/0/#search/job+position
console.log([...document.querySelectorAll('span')]
.filter((el, idx) => el.getAttribute('email') && idx % 2 === 1)
.map(el => el.getAttribute('email')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment