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

View File

@ -95,7 +95,11 @@ class IndeedScraper(Scraper):
or self.scraper_input.country.value[0].split(",")[-1]
)
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,
radius=self.scraper_input.distance,
dateOnIndeed=self.scraper_input.hours_old,
@ -338,7 +342,7 @@ class IndeedScraper(Scraper):
job_search_query = """
query GetJobData {{
jobSearch(
what: "{what}"
{what}
location: {{ where: "{location}", radius: {radius}, radiusUnit: MILES }}
includeSponsoredResults: NONE
limit: 100