Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4405d01

Browse files
Update emails-from-website.py
1 parent 0d75e46 commit 4405d01

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

‎extracting-emails-from-website/emails-from-website.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
for i in x:
1111
val+=i+"\n" #this adds all the email data found in val variable
1212

13-
filename= input("Enter the file Name you want (without extension):")
14-
with open(f"{filename}.txt","w") as file:
15-
file.write(val)
16-
print("Your File has been Saved")
17-
print("Email(s) found:\n")
18-
print(val)
13+
if val=="":
14+
print("No emails found in the website")
15+
else:
16+
filename= input("Enter the file Name you want (without extension):")
17+
with open(f"{filename}.txt","w") as file:
18+
file.write(val)
19+
print("Your File has been Saved")
20+
print("Email(s) found:\n")
21+
print(val)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /