mirror of
https://github.com/Bunsly/JobSpy.git
synced 2026-03-11 07:54:33 -07:00
feat: Ability to query by time posted for linkedin, indeed, glassdoor, ziprecruiter (#103)
This commit is contained in:
@@ -363,12 +363,15 @@ class IndeedScraper(Scraper):
|
||||
|
||||
@staticmethod
|
||||
def add_params(scraper_input: ScraperInput, page: int) -> dict[str, str | Any]:
|
||||
# `fromage` is the posting time filter in days
|
||||
fromage = max(scraper_input.hours_old // 24, 1) if scraper_input.hours_old else None
|
||||
params = {
|
||||
"q": scraper_input.search_term,
|
||||
"l": scraper_input.location if scraper_input.location else scraper_input.country.value[0].split(',')[-1],
|
||||
"filter": 0,
|
||||
"start": scraper_input.offset + page * 10,
|
||||
"sort": "date"
|
||||
"sort": "date",
|
||||
"fromage": fromage,
|
||||
}
|
||||
if scraper_input.distance:
|
||||
params["radius"] = scraper_input.distance
|
||||
@@ -405,8 +408,7 @@ class IndeedScraper(Scraper):
|
||||
)
|
||||
return is_remote_in_attributes or is_remote_in_description or is_remote_in_location
|
||||
|
||||
@staticmethod
|
||||
def get_job_details(job_keys: list[str]) -> dict:
|
||||
def get_job_details(self, job_keys: list[str]) -> dict:
|
||||
"""
|
||||
Queries the GraphQL endpoint for detailed job information for the given job keys.
|
||||
"""
|
||||
@@ -478,7 +480,7 @@ class IndeedScraper(Scraper):
|
||||
}}
|
||||
"""
|
||||
}
|
||||
response = requests.post(url, headers=headers, json=payload)
|
||||
response = requests.post(url, headers=headers, json=payload, proxies=self.proxy)
|
||||
if response.status_code == 200:
|
||||
return response.json()['data']['jobData']['results']
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user