Skip to content
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit 11df0d4

Browse files
Scrape News from Google News (Update #3)
1 parent 5f70652 commit 11df0d4

File tree

1 file changed

+8
-3
lines changed
  • Scripts/Web_Scrappers/google_news_(ui_based)

1 file changed

+8
-3
lines changed

Scripts/Web_Scrappers/google_news_(ui_based)/main.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def fetch_news(link, file_name='custom_news.txt'):
6363
ch = int(input('Enter your choice (Eg : 1 for Business): '))
6464
print('')
6565

66-
print('Enter the sub-topic of the category you selected. You can choose from :')
6766
fetch = ""
6867
if(ch==1):
68+
print('Enter the sub-topic of the category you selected. You can choose from :')
6969
print('\t a. Latest')
7070
print('\t b. Economy')
7171
print('\t c. Markets')
@@ -89,6 +89,7 @@ def fetch_news(link, file_name='custom_news.txt'):
8989
print('Invalid Choice!')
9090
c2=False
9191
elif(ch==2):
92+
print('Enter the sub-topic of the category you selected. You can choose from :')
9293
print('\t a. Latest')
9394
print('\t b. Mobile')
9495
print('\t c. Gadgets')
@@ -115,6 +116,7 @@ def fetch_news(link, file_name='custom_news.txt'):
115116
print('Invalid Choice!')
116117
c2=False
117118
elif(ch==3):
119+
print('Enter the sub-topic of the category you selected. You can choose from :')
118120
print('\t a. Latest')
119121
print('\t b. Movies')
120122
print('\t c. Music')
@@ -141,6 +143,7 @@ def fetch_news(link, file_name='custom_news.txt'):
141143
print('Invalid Choice!')
142144
c2=False
143145
elif(ch==4):
146+
print('Enter the sub-topic of the category you selected. You can choose from :')
144147
print('\t a. Latest')
145148
print('\t b. Cricket')
146149
print('\t c. Hockey')
@@ -176,6 +179,7 @@ def fetch_news(link, file_name='custom_news.txt'):
176179
print('Invalid Choice!')
177180
c2=False
178181
elif(ch==5):
182+
print('Enter the sub-topic of the category you selected. You can choose from :')
179183
print('\t a. Latest')
180184
print('\t b. Environment')
181185
print('\t c. Outer space')
@@ -199,6 +203,7 @@ def fetch_news(link, file_name='custom_news.txt'):
199203
print('Invalid Choice!')
200204
c2=False
201205
elif(ch==6):
206+
print('Enter the sub-topic of the category you selected. You can choose from :')
202207
print('\t a. Latest')
203208
print('\t b. Medicine')
204209
print('\t c. Healthcare')
@@ -225,9 +230,9 @@ def fetch_news(link, file_name='custom_news.txt'):
225230
c1=False
226231
print('')
227232
cond = c1 & c2
228-
if cond == True:
233+
if cond is True:
229234
print('Fetching your custom News...')
230235
fetch_news(link=fetch)
231236
print('Thank You')
232237
else:
233-
print('The program will now exit!')
238+
print('The program will now exit!')

0 commit comments

Comments
 (0)