mirror of
https://github.com/Bunsly/JobSpy.git
synced 2026-03-05 12:04:33 -08:00
chore: id added for JobPost schema (#152)
This commit is contained in:
@@ -209,6 +209,7 @@ class LinkedInScraper(Scraper):
|
||||
job_details = self._get_job_details(job_url)
|
||||
|
||||
return JobPost(
|
||||
id=self._get_id(job_url),
|
||||
title=title,
|
||||
company_name=company,
|
||||
company_url=company_url,
|
||||
@@ -223,6 +224,16 @@ class LinkedInScraper(Scraper):
|
||||
logo_photo_url=job_details.get("logo_photo_url"),
|
||||
)
|
||||
|
||||
def _get_id(self, url: str):
|
||||
"""
|
||||
Extracts the job id from the job url
|
||||
:param url:
|
||||
:return: str
|
||||
"""
|
||||
if not url:
|
||||
return None
|
||||
return url.split("/")[-1]
|
||||
|
||||
def _get_job_details(self, job_page_url: str) -> dict:
|
||||
"""
|
||||
Retrieves job description and other job details by going to the job page url
|
||||
|
||||
Reference in New Issue
Block a user