fix: indeed empty search term

pull/128/head v1.1.49
Cullen Watson 2024-03-11 09:21:11 -05:00
parent 94d8f555fd
commit 3b0017964c
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "python-jobspy" name = "python-jobspy"
version = "1.1.48" version = "1.1.49"
description = "Job scraper for LinkedIn, Indeed, Glassdoor & ZipRecruiter" description = "Job scraper for LinkedIn, Indeed, Glassdoor & ZipRecruiter"
authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"] authors = ["Zachary Hampton <zachary@bunsly.com>", "Cullen Watson <cullen@bunsly.com>"]
homepage = "https://github.com/Bunsly/JobSpy" homepage = "https://github.com/Bunsly/JobSpy"

View File

@ -95,7 +95,11 @@ class IndeedScraper(Scraper):
or self.scraper_input.country.value[0].split(",")[-1] or self.scraper_input.country.value[0].split(",")[-1]
) )
query = self.job_search_query.format( query = self.job_search_query.format(
what=self.scraper_input.search_term, what=(
f'what: "{self.scraper_input.search_term}"'
if self.scraper_input.search_term
else ""
),
location=location, location=location,
radius=self.scraper_input.distance, radius=self.scraper_input.distance,
dateOnIndeed=self.scraper_input.hours_old, dateOnIndeed=self.scraper_input.hours_old,
@ -338,7 +342,7 @@ class IndeedScraper(Scraper):
job_search_query = """ job_search_query = """
query GetJobData {{ query GetJobData {{
jobSearch( jobSearch(
what: "{what}" {what}
location: {{ where: "{location}", radius: {radius}, radiusUnit: MILES }} location: {{ where: "{location}", radius: {radius}, radiusUnit: MILES }}
includeSponsoredResults: NONE includeSponsoredResults: NONE
limit: 100 limit: 100