mirror of https://github.com/Bunsly/JobSpy
fix(zip_recruiter): return none if location not found
parent
2a96fdc8a5
commit
5046fad850
|
@ -211,9 +211,16 @@ class ZipRecruiterScraper(Scraper):
|
||||||
:param job:
|
:param job:
|
||||||
:return: location
|
:return: location
|
||||||
"""
|
"""
|
||||||
location_string = job.find("a", {"class": "company_location"}).text.strip()
|
location_link = job.find("a", {"class": "company_location"})
|
||||||
parts = location_string.split(", ")
|
if location_link is not None:
|
||||||
city, state = parts
|
location_string = location_link.text.strip()
|
||||||
|
parts = location_string.split(", ")
|
||||||
|
if len(parts) == 2:
|
||||||
|
city, state = parts
|
||||||
|
else:
|
||||||
|
city, state = None, None
|
||||||
|
else:
|
||||||
|
city, state = None, None
|
||||||
return Location(
|
return Location(
|
||||||
country="US",
|
country="US",
|
||||||
city=city,
|
city=city,
|
||||||
|
|
Loading…
Reference in New Issue