- scraper init

pull/1/head
zacharyhampton 2023-07-06 19:12:01 -05:00
parent bb48caaadd
commit 38f98fe595
3 changed files with 36 additions and 1 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
/.idea
/.idea
.DS_Store

View File

@ -53,3 +53,12 @@ class JobPost(BaseModel):
compensation: Compensation
date_posted: datetime
delivery: Delivery = None
class JobResponse(BaseModel):
jobs: list[JobPost]
job_count: int
page: int
total_pages: int

View File

@ -0,0 +1,25 @@
from pydantic import BaseModel
from enum import Enum
from ..jobs import JobResponse, JobPost
class Site(Enum):
LINKEDIN = "linkedin"
INDEED = "indeed"
ZIP_RECRUITER = "zip_recruiter"
class ScraperInput(BaseModel):
site: Site
location: str
search_term: str
page: int = None
class Scraper: #: to be used as a child class
def __init__(self, site: Site):
self.site = site
def scrape(self, scraper_input: ScraperInput) -> JobResponse: ...