mirror of
https://github.com/Bunsly/JobSpy.git
synced 2026-03-05 03:54:31 -08:00
- scraper init
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
Reference in New Issue
Block a user