2023-07-06 17:12:01 -07:00
|
|
|
from pydantic import BaseModel
|
|
|
|
from enum import Enum
|
2023-07-10 20:07:19 -07:00
|
|
|
from ..jobs import JobResponse
|
2023-07-06 17:12:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
class Site(Enum):
|
|
|
|
LINKEDIN = "linkedin"
|
|
|
|
INDEED = "indeed"
|
|
|
|
ZIP_RECRUITER = "zip_recruiter"
|
|
|
|
|
|
|
|
|
|
|
|
class ScraperInput(BaseModel):
|
2023-07-10 16:04:44 -07:00
|
|
|
site_type: Site
|
|
|
|
|
2023-07-06 17:12:01 -07:00
|
|
|
search_term: str
|
2023-07-10 16:04:44 -07:00
|
|
|
location: str
|
2023-07-10 14:14:05 -07:00
|
|
|
distance: int = 25
|
2023-07-10 16:04:44 -07:00
|
|
|
|
2023-07-10 20:07:19 -07:00
|
|
|
results_wanted: int = 15
|
2023-07-06 17:12:01 -07:00
|
|
|
|
|
|
|
|
2023-07-10 20:07:19 -07:00
|
|
|
class Scraper:
|
2023-07-06 17:12:01 -07:00
|
|
|
def __init__(self, site: Site):
|
|
|
|
self.site = site
|
|
|
|
|
2023-07-10 20:07:19 -07:00
|
|
|
def scrape(self, scraper_input: ScraperInput) -> JobResponse:
|
|
|
|
...
|