Scrape all email addresses from a webpage

Updated: 10 January 2025

The bash script. Outputs a sorted and unique list of email addresses

#!/bin/bash

curl --silent https://lots-of-emails.example.com | \
grep -Po --file=email-regex.txt | sort | uniq

The --file option to grep reads the pattern to find from a file.

See here for an example email matching regex.

Leave a comment