File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
code/daniel/mini_capstone Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ import re # for regular expression matching operations
2
+ # import requests # for sending HTTP requests
3
+ # from urllib.parse import urlsplit # for breaking URLs down into component parts
4
+ # from collections import deque # is a list-like container with fast appends and pops on either end
5
+ # from bs4 import BeautifulSoup # for pulling data out of HTML files of websites
6
+
7
+
8
+
9
+ # target_webpage = input("Enter a target url to have the emails scraped: ")
10
+ # unscraped_url = deque(target_webpage)
11
+ # scraped_url = set()
12
+ # scraped_email = set()
13
+
14
+
15
+ #===================================================================
16
+ #Regex Examples
17
+ #===================================================================
18
+
19
+ email = input ("Type email: " )
20
+
21
+ regex = re .compile (r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+' )
22
+
23
+
24
+ def isValid (email ):
25
+ if re .fullmatch (regex , email ):
26
+ print ("Valid email" )
27
+ else :
28
+ print ("Invalid email" )
29
+
30
+ isValid (email )
You can’t perform that action at this time.
0 commit comments