mirror of
https://github.com/Bunsly/JobSpy.git
synced 2026-03-08 14:34:29 -07:00
Add Csv output (#20)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from ..jobs import *
|
||||
from typing import List
|
||||
from ..formatters import OutputFormat
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
|
||||
class StatusException(Exception):
|
||||
@@ -16,6 +17,7 @@ class Site(Enum):
|
||||
class ScraperInput(BaseModel):
|
||||
site_type: List[Site]
|
||||
search_term: str
|
||||
output_format: OutputFormat = OutputFormat.JSON
|
||||
|
||||
location: str = None
|
||||
distance: int = None
|
||||
@@ -26,6 +28,12 @@ class ScraperInput(BaseModel):
|
||||
results_wanted: int = 15
|
||||
|
||||
|
||||
class ScraperResponse(BaseModel):
|
||||
linkedin: Optional[JobResponse]
|
||||
indeed: Optional[JobResponse]
|
||||
zip_recruiter: Optional[JobResponse]
|
||||
|
||||
|
||||
class Scraper:
|
||||
def __init__(self, site: Site, url: str):
|
||||
self.site = site
|
||||
|
||||
@@ -96,7 +96,9 @@ class ZipRecruiterScraper(Scraper):
|
||||
title = job.find("h2", {"class": "title"}).text
|
||||
company = job.find("a", {"class": "company_name"}).text.strip()
|
||||
|
||||
description, updated_job_url = ZipRecruiterScraper.get_description(job_url, session)
|
||||
description, updated_job_url = ZipRecruiterScraper.get_description(
|
||||
job_url, session
|
||||
)
|
||||
if updated_job_url is not None:
|
||||
job_url = updated_job_url
|
||||
if description is None:
|
||||
|
||||
Reference in New Issue
Block a user