ecomgoat999
Registered Member
- Mar 18, 2023
- 85
- 68
I have been busting my ass to find something that can scrape emails from a list of URLs. I don't have to explain why this would be useful so I'm gonna jump to the good stuff.
It's easier than you think. You don't need any paid tools. You only need google sheets.
I am going to assume you have a list of URLs and you want to scrape emails that are on those pages. Email doesn't have to be linked or anything, this method works even if the email is plain text.
There is a method I use to create this list and if anyone is interested, I'll share it. For now, I am going to explain how to scrape emails only.
Go to google sheets. Paste your URL list in column A. What I like to do is, add a slug /contact if I have a list of home pages. Also, I add a slug /policies/privacy-policy and I add some more slugs, based on common sense. Just think where on the website you can find an email address.
Now you need to add .xml to every url. Use this function in B1 and populate entire column: =CONCATENATE(A1, ".xml")
Now you have a list of urls that looks something like this samplewebsite.com/contact.xml
Copy entire list and paste as values in separate column and delete everything else. Move tha url list to A column.
Now the scraping part, use this function: =IFERROR(REGEXEXTRACT(IMPORTXML(A1, "//body"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}"), "No emails found.")
It will take some time to finish so be gentle with it, you could get an error if you push it hard (populating the rest of the results column).
That's it, easy peazy.
It's easier than you think. You don't need any paid tools. You only need google sheets.
I am going to assume you have a list of URLs and you want to scrape emails that are on those pages. Email doesn't have to be linked or anything, this method works even if the email is plain text.
There is a method I use to create this list and if anyone is interested, I'll share it. For now, I am going to explain how to scrape emails only.
Go to google sheets. Paste your URL list in column A. What I like to do is, add a slug /contact if I have a list of home pages. Also, I add a slug /policies/privacy-policy and I add some more slugs, based on common sense. Just think where on the website you can find an email address.
Now you need to add .xml to every url. Use this function in B1 and populate entire column: =CONCATENATE(A1, ".xml")
Now you have a list of urls that looks something like this samplewebsite.com/contact.xml
Copy entire list and paste as values in separate column and delete everything else. Move tha url list to A column.
Now the scraping part, use this function: =IFERROR(REGEXEXTRACT(IMPORTXML(A1, "//body"), "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}"), "No emails found.")
It will take some time to finish so be gentle with it, you could get an error if you push it hard (populating the rest of the results column).
That's it, easy peazy.