You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB
Python

"""DOCS Health adapter — Paylocity-hosted job board, single-page results."""
from __future__ import annotations
from loguru import logger
from gimme_job.adapters.base import ManifestDrivenAdapter
from gimme_job.adapters.registry import register
from gimme_job.models.dto import JobPostingCandidate, RawJobCard
@register("docshealth")
class DocsHealthAdapter(ManifestDrivenAdapter):
_BASE_URL = "https://recruiting.paylocity.com"
_COMPANY = "DOCS Health"
def collect_cards(self, page, manifest):
# Wait for job listings to render
try:
page.wait_for_selector(".job-listing-job-item", timeout=12000, state="attached")
except Exception:
logger.debug("[docshealth] Results wait timed out — may be zero results")
return super().collect_cards(page, manifest)
def normalize(self, raw: RawJobCard) -> JobPostingCandidate:
candidate = super().normalize(raw)
# Fix relative URL → absolute
if candidate.job_url and candidate.job_url.startswith("/"):
candidate.job_url = self._BASE_URL + candidate.job_url
# Company is always DOCS Health (not in per-card HTML)
candidate.company = self._COMPANY
# Clean posted_text: "03/27/2026 - " → "03/27/2026"
if candidate.posted_text:
candidate.posted_text = candidate.posted_text.replace(" - ", "").strip()
return candidate