-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (21 loc) · 836 Bytes
/
main.py
File metadata and controls
27 lines (21 loc) · 836 Bytes
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
from utils.property_scraper import PropertyScraper
def main():
print("\n🔍 Getting data...")
scraper = PropertyScraper()
try:
categories = ["HOUSE", "APARTMENT"]
filenames = []
for category in categories:
filename = f"properties_{category.lower()}.csv"
summary = scraper.scrape_all_price_ranges(category_type=category, filename=filename)
print(scraper.get_summary_report(summary))
filenames.append(filename)
user_input = input("\n📖 Do you want to preview results? ('y' to confirm): ")
if user_input.lower() == "y":
for fname in filenames:
scraper.output.read_csv(fname)
scraper.output.output_info(fname)
finally:
scraper.cleanup()
if __name__ == "__main__":
main()