256 Kilobytes

Extracting Emails from HTML with Google Sheets: Get Contact Information in Bulk for Guest Posts, (lmao) 404 Replacement, and Other Outreach

Articles in Web Scraping, Data Analysis | By August R. Garcia

Published 8 months agoSat, 25 May 2019 17:20:37 -0700

What a nice trick.

436 views, 0 RAMs, and 0 comments

What a nice trick.


function get_raw_html(url) {
  // The code below logs the HTML code of the Google home page.
  var response = UrlFetchApp.fetch(url);
  if (!response) return "No Response Found";
  var text     = response.getContentText();
  if (!text) return "No Text Found";
  var emails   = extract_emails(text);
  if (!emails) return "No Emails Found";
  var result   = emails.join(); 

  return result; 

function extract_emails( text ) {
//  var regex = /(?:^|\s|$)([a-zA-Z0-9.\+_-]+@[a-zA-Z0-9._-]+)/gi;
  var regex = /(?:^|\s|$)([a-zA-Z0-9.\+_-]+@[a-zA-Z0-9._-]+[a-zA-Z0-9_-]{1})/gi;
  var matches = [];
  var match;
  while (match = regex.exec(text)) { matches.push(match[1]); }
  return matches;

Resources Mentioned

Download more RAM. 🐏 ⨉ 0 Posted by August R. Garcia 8 months ago 🕓 Posted at 25 May, 2019 17:20 PM PDT

Profile Photo - August R. Garcia August R. Garcia LARPing as a Sysadmi... Portland, OR
🗎 211 🗨 1092 🐏 328
Site Owner

Grahew Mattham

August Garcia is some guy who used to sell Viagra on the Internet. He made this website to LARP as a sysadmin while posting about garbage like user-agent spoofing, spintax, the only good keyboard, virtual assitants from Pakistan, links with the rel="nofollow" attributeproxiessin, the developer console, literally every link building method, and other junk.

Available at arg@256kilobytes.com, via Twitter, or arg.256kilobytes.com. Open to business inquiries based on availability.

Account created 1 year ago.
211 posts, 1092 comments, and 328 RAMs.

Last active 16 hours ago:
Commented in thread Control Your Audio Conferences

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.