mirror of
https://github.com/Bunsly/JobSpy.git
synced 2026-03-04 19:44:30 -08:00
fix(linkedin): resolve issue where locaion is null
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user