fix(linkedin): add fallback for date parsing on new job listings (#343)

LinkedIn uses two CSS classes for job posting dates:
- `job-search-card__listdate` for older posts
- `job-search-card__listdate--new` for recent posts (< 24h)

The scraper only checked the first class, causing `date_posted` to be
None for all fresh listings. This adds a fallback to also check for
the `--new` variant.
This commit is contained in:
Berkay Gemici
2026-02-18 20:39:52 +01:00
committed by GitHub
parent 6e7ab6ff74
commit fda080a373

View File

@@ -209,6 +209,10 @@ class LinkedIn(Scraper):
if metadata_card
else None
)
if not datetime_tag and metadata_card:
datetime_tag = metadata_card.find(
"time", class_="job-search-card__listdate--new"
)
date_posted = None
if datetime_tag and "datetime" in datetime_tag.attrs:
datetime_str = datetime_tag["datetime"]