mirror of https://github.com/Bunsly/JobSpy
- scraper init
parent
bb48caaadd
commit
38f98fe595
|
@ -1 +1,2 @@
|
||||||
/.idea
|
/.idea
|
||||||
|
.DS_Store
|
|
@ -53,3 +53,12 @@ class JobPost(BaseModel):
|
||||||
compensation: Compensation
|
compensation: Compensation
|
||||||
date_posted: datetime
|
date_posted: datetime
|
||||||
delivery: Delivery = None
|
delivery: Delivery = None
|
||||||
|
|
||||||
|
|
||||||
|
class JobResponse(BaseModel):
|
||||||
|
jobs: list[JobPost]
|
||||||
|
|
||||||
|
job_count: int
|
||||||
|
|
||||||
|
page: int
|
||||||
|
total_pages: int
|
||||||
|
|
|
@ -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: ...
|
Loading…
Reference in New Issue