Created
November 3, 2019 00:05
-
-
Save bran921007/e9ac81c2566d2149c21fff14a9eadb62 to your computer and use it in GitHub Desktop.
Web Scraping for Email Addresses and Phone numbers using Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Small Python Script to scrape websites for | |
# email addresses and phone numbers(not a very great RE) | |
# Author: Dhruv Baldawa (@dhruvbaldawa on twitter) | |
# Github: http://www.github.com/dhruvbaldawa | |
import urllib,re | |
f = urllib.urlopen("http://www.example.com") | |
s = f.read() | |
re.findall(r"\+\d{2}\s?0?\d{10}",s) | |
re.findall(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",s) | |
# Output | |
# ['+02 2323123789', '+01 2334325323', '+00 2323123323'] | |
# ['[email protected]'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment