Skip to content

Commit fda080a

Browse files
authored
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.
1 parent 6e7ab6f commit fda080a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎jobspy/linkedin/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ def _process_job(
209209
if metadata_card
210210
else None
211211
)
212+
if not datetime_tag and metadata_card:
213+
datetime_tag = metadata_card.find(
214+
"time", class_="job-search-card__listdate--new"
215+
)
212216
date_posted = None
213217
if datetime_tag and "datetime" in datetime_tag.attrs:
214218
datetime_str = datetime_tag["datetime"]

0 commit comments

Comments
 (0)