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