-
Notifications
You must be signed in to change notification settings - Fork 0
/
scraper.py
41 lines (33 loc) · 965 Bytes
/
scraper.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
"""
This file is responsible for the backend logic that scrapes information
about a location after it has been determined in the application.
"""
import beautifulsoup4 as bs
class Scraper():
def __init__(
self,
location: str
) -> None:
""" Constructor method. """
pass
def scrape(self) -> list[str]:
""" Returns a list of relevant information about location. """
pass
def format(
self,
data: list[str]
) -> None:
""" Formats the relevant information before being returned to the
application. """
pass
def run(self) -> dict[str]:
""" Scrapes, formats, and returns json-formatted information about
location to the application. """
data = self.scrape()
return self.format(data)
if __name__=="__main__":
# inputs:
# location name
# address + location
scraper = Scraper()
scraper.run()