fix(linkedin): resolve issue where locaion is null

pull/12/head
Cullen Watson 2023-07-08 21:16:34 -05:00
parent 0da7ea59d0
commit 405842f90e
4 changed files with 8 additions and 7 deletions

4
.gitignore vendored
View File

@ -1,6 +1,6 @@
/.idea
.DS_Store
**/.DS_Store
/venv/
/ven/
**/__pycache__/
*.pyc
*.pyc

View File

@ -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

View File

@ -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"

View File

@ -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 = {