From 3dc8c0c0661ec31d5424c784991760503ee3dde3 Mon Sep 17 00:00:00 2001 From: WillBlears Date: Fri, 17 Nov 2023 07:11:32 -0500 Subject: [PATCH] was erroring when job post had countryname not in mapping --- src/jobspy/scrapers/linkedin/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jobspy/scrapers/linkedin/__init__.py b/src/jobspy/scrapers/linkedin/__init__.py index 67d2898..6383837 100644 --- a/src/jobspy/scrapers/linkedin/__init__.py +++ b/src/jobspy/scrapers/linkedin/__init__.py @@ -280,10 +280,15 @@ class LinkedInScraper(Scraper): ) elif len(parts) == 3: city, state, country = parts + try: + country_enum = Country.from_string(country) + except ValueError: + country_enum = Country.from_string(self.country) location = Location( city=city, state=state, - country=Country.from_string(country), + country=country_enum, ) return location +