Skip to content

Commit

Permalink
fix: job type param bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cullenwatson committed Sep 21, 2023
1 parent efad1a1 commit 558e352
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "python-jobspy"
version = "1.1.4"
version = "1.1.5"
description = "Job scraper for LinkedIn, Indeed & ZipRecruiter"
authors = ["Zachary Hampton <[email protected]>", "Cullen Watson <[email protected]>"]
homepage = "https://github.com/cullenwatson/JobSpy"
Expand Down
10 changes: 9 additions & 1 deletion src/jobspy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def scrape_jobs(
location: str = "",
distance: int = None,
is_remote: bool = False,
job_type: JobType = None,
job_type: str = None,
easy_apply: bool = False, # linkedin
results_wanted: int = 15,
country_indeed: str = "usa",
Expand All @@ -44,6 +44,14 @@ def scrape_jobs(
:return: results_wanted: pandas dataframe containing job data
"""

def get_enum_from_value(value_str):
for job_type in JobType:
if value_str in job_type.value:
return job_type
raise Exception(f"Invalid job type: {value_str}")
job_type = get_enum_from_value(job_type) if job_type else None


if type(site_name) == str:
site_type = [_map_str_to_site(site_name)]
else: #: if type(site_name) == list
Expand Down

0 comments on commit 558e352

Please sign in to comment.