mirror of https://github.com/Bunsly/JobSpy
- new schema (includes bugs)
parent
ad8b27ac00
commit
8c7d924a85
|
@ -6,3 +6,4 @@
|
|||
*.pyc
|
||||
.env
|
||||
client_secret.json
|
||||
dist
|
|
@ -7,12 +7,11 @@ from .core.scrapers import (
|
|||
ScraperInput,
|
||||
Site,
|
||||
JobResponse,
|
||||
CommonResponse,
|
||||
)
|
||||
|
||||
import pandas as pd
|
||||
from .core.jobs import JobType
|
||||
from typing import List, Dict, Tuple, Union
|
||||
from typing import List, Tuple
|
||||
|
||||
SCRAPER_MAPPING = {
|
||||
Site.LINKEDIN: LinkedInScraper,
|
||||
|
@ -49,13 +48,17 @@ def scrape_jobs(
|
|||
site_type=site_type,
|
||||
search_term=search_term,
|
||||
location=location,
|
||||
distance=distance,
|
||||
is_remote=is_remote,
|
||||
job_type=job_type,
|
||||
easy_apply=easy_apply,
|
||||
results_wanted=results_wanted,
|
||||
)
|
||||
|
||||
if distance:
|
||||
scraper_input.distance = distance
|
||||
|
||||
if job_type:
|
||||
scraper_input.job_type = job_type
|
||||
|
||||
def scrape_site(site: Site) -> Tuple[str, JobResponse]:
|
||||
scraper_class = SCRAPER_MAPPING[site]
|
||||
scraper = scraper_class()
|
|
@ -21,8 +21,8 @@ class JobType(Enum):
|
|||
|
||||
class Location(BaseModel):
|
||||
country: str = "USA"
|
||||
city: str = None
|
||||
state: str = None
|
||||
city: str = ""
|
||||
state: str = ""
|
||||
|
||||
|
||||
class CompensationInterval(Enum):
|
|
@ -127,15 +127,20 @@ class IndeedScraper(Scraper):
|
|||
description=description,
|
||||
company_name=job["company"],
|
||||
location=Location(
|
||||
city=job.get("jobLocationCity"),
|
||||
state=job.get("jobLocationState"),
|
||||
postal_code=job.get("jobLocationPostal"),
|
||||
city=job.get("jobLocationCity", ""),
|
||||
state=job.get("jobLocationState", ""),
|
||||
postal_code=job.get("jobLocationPostal", ""),
|
||||
),
|
||||
job_type=job_type,
|
||||
compensation=compensation,
|
||||
date_posted=date_posted,
|
||||
job_url=job_url_client,
|
||||
)
|
||||
|
||||
if compensation:
|
||||
job_post.compensation = compensation
|
||||
|
||||
if job_type:
|
||||
job_post.job_type = job_type
|
||||
|
||||
return job_post
|
||||
|
||||
for job in jobs["metaData"]["mosaicProviderJobCardsModel"]["results"]:
|
|
@ -1,4 +1,4 @@
|
|||
from src import scrape_jobs
|
||||
from src.jobspy import scrape_jobs
|
||||
|
||||
|
||||
def test_indeed():
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from src import scrape_jobs
|
||||
from src.jobspy import scrape_jobs
|
||||
|
||||
|
||||
def test_ziprecruiter():
|
||||
|
|
Loading…
Reference in New Issue