ziprecruiter api (#63)

pull/64/head
Cullen Watson 2023-10-28 16:17:28 -05:00 committed by GitHub
parent ba5ed803ca
commit d3bfdc0a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "python-jobspy"
version = "1.1.15"
version = "1.1.16"
description = "Job scraper for LinkedIn, Indeed & ZipRecruiter"
authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"]
homepage = "https://github.com/Bunsly/JobSpy"

View File

@ -177,8 +177,8 @@ class CompensationInterval(Enum):
class Compensation(BaseModel):
interval: Optional[CompensationInterval] = None
min_amount: int = None
max_amount: int = None
min_amount: int | None = None
max_amount: int | None = None
currency: Optional[str] = "USD"

View File

@ -113,12 +113,12 @@ class ZipRecruiterScraper(Scraper):
title = job.get("name")
job_url = job.get("job_url")
# job_url = updated_job_url if updated_job_url else job_url
description = BeautifulSoup(
job.get("job_description", "").strip(), "html.parser"
).get_text()
company = job.get("source")
company = job['hiring_company'].get("name") if "hiring_company" in job else None
location = Location(
city=job.get("job_city"), state=job.get("job_state"), country='usa' if job.get("job_country") == 'US' else 'canada'
)
@ -137,12 +137,18 @@ class ZipRecruiterScraper(Scraper):
else:
date_posted = date.today()
return JobPost(
title=title,
company_name=company,
location=location,
job_type=job_type,
# compensation=compensation,
compensation=Compensation(
interval="yearly" if job.get("compensation_interval") == "annual" else job.get("compensation_interval") ,
min_amount=int(job["compensation_min"]) if "compensation_min" in job else None,
max_amount=int(job["compensation_max"]) if "compensation_max" in job else None,
currency=job.get("compensation_currency"),
),
date_posted=date_posted,
job_url=job_url,
description=description,