JobSpy/src/jobspy/scrapers/__init__.py

35 lines
901 B
Python
Raw Normal View History

2023-09-05 10:17:22 -07:00
from ..jobs import Enum, BaseModel, JobType, JobResponse, Country
2023-07-06 17:12:01 -07:00
class Site(Enum):
LINKEDIN = "linkedin"
INDEED = "indeed"
ZIP_RECRUITER = "zip_recruiter"
2023-10-30 17:57:36 -07:00
GLASSDOOR = "glassdoor"
2023-07-06 17:12:01 -07:00
class ScraperInput(BaseModel):
site_type: list[Site]
search_term: str | None = None
2023-07-11 03:42:20 -07:00
location: str | None = None
country: Country | None = Country.USA
distance: int | None = None
2023-07-11 03:42:20 -07:00
is_remote: bool = False
job_type: JobType | None = None
easy_apply: bool | None = None
2024-01-22 18:22:32 -08:00
full_description: bool = False
offset: int = 0
linkedin_company_ids: list[int] | None = None
2023-07-10 16:04:44 -07:00
results_wanted: int = 15
2023-07-06 17:12:01 -07:00
class Scraper:
def __init__(self, site: Site, proxy: list[str] | None = None):
2023-07-06 17:12:01 -07:00
self.site = site
self.proxy = (lambda p: {"http": p, "https": p} if p else None)(proxy)
2023-07-06 17:12:01 -07:00
def scrape(self, scraper_input: ScraperInput) -> JobResponse:
...