mirror of https://github.com/Bunsly/JobSpy
fix(linkedin): resolve issue where locaion is null
parent
0da7ea59d0
commit
405842f90e
|
@ -1,6 +1,6 @@
|
|||
/.idea
|
||||
.DS_Store
|
||||
**/.DS_Store
|
||||
/venv/
|
||||
/ven/
|
||||
**/__pycache__/
|
||||
*.pyc
|
||||
*.pyc
|
||||
|
|
|
@ -15,8 +15,8 @@ class JobType(Enum):
|
|||
|
||||
class Location(BaseModel):
|
||||
country: str
|
||||
city: str
|
||||
state: str
|
||||
city: str = None
|
||||
state: str = None
|
||||
postal_code: str = None
|
||||
address: str = None
|
||||
|
||||
|
|
|
@ -78,6 +78,9 @@ class LinkedInScraper(Scraper):
|
|||
|
||||
@staticmethod
|
||||
def get_location(metadata_card):
|
||||
location = Location(
|
||||
country="US",
|
||||
)
|
||||
if metadata_card is not None:
|
||||
location_tag = metadata_card.find(
|
||||
"span", class_="job-search-card__location"
|
||||
|
|
|
@ -9,9 +9,7 @@ router = APIRouter(prefix="/jobs")
|
|||
|
||||
|
||||
@router.get("/")
|
||||
async def scrape_jobs(
|
||||
site_type: str, search_term: str, location: str, page: int = None
|
||||
):
|
||||
async def scrape_jobs(site_type: str, search_term: str, location: str, page: int = 1):
|
||||
job_response = {"message": "site type not found"}
|
||||
|
||||
scraper_dict = {
|
||||
|
|
Loading…
Reference in New Issue