-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
53 lines (42 loc) · 1.45 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
def run_amazon():
os.system('python amazon.py')
def run_flipkart():
os.system('python flipkart.py')
def main():
print("Welcome to the Web Scraper")
while True:
should_countinue = True
print("\nEnter 1 to run Amazon Scraping")
print("Enter 2 to run Flipkart Scraping")
print("Enter 3 to exit")
user_input = input("\nPlease enter your choice » ")
if user_input == '1':
run_amazon()
print("Do you want to compare the price on Flipkart")
comp_inp=input("\nYes/No: ")
if comp_inp == 'Yes':
run_flipkart()
elif comp_inp == 'No':
should_countinue=False
else:
print("Please enter either Yes or No")
elif user_input == '2':
run_flipkart()
print("Do you want to compare the price on Flipkart")
comp_inp = input("\nYes/No: ")
if comp_inp == 'Yes':
run_amazon()
elif comp_inp == 'No':
should_countinue = False
else:
print("Please enter either Yes or No")
elif user_input == '3':
print(
"\nThank You! for using Web Scraper")
print("\n")
break
else:
print("Please enter 1, 2 or 3")
if __name__ == '__main__':
main()