You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.4 KiB
73 lines
1.4 KiB
import csv |
|
|
|
import json |
|
|
|
from datetime import datetime |
|
|
|
from jobspy import scrape_jobs |
|
|
|
def dowork(): |
|
|
|
jobs = scrape_jobs( |
|
|
|
site_name=["indeed", "linkedin", "zip_recruiter", "glassdoor", "google"], |
|
|
|
search_term="build release engineer", |
|
|
|
google_search_term="build and release engineer jobs near durham, nc", |
|
|
|
location="durham, nc", |
|
|
|
results_wanted=50, |
|
|
|
hours_old=72, # (only Linkedin/Indeed is hour specific, others round up to days old) |
|
|
|
country_indeed='USA', # only needed for indeed / glassdoor |
|
|
|
) |
|
|
|
print(f"scraper seearch completed. found {len(jobs)} jobs.") |
|
|
|
print(jobs.head()) |
|
|
|
# Convert DataFrame to JSON string |
|
json_string = jobs.to_json(orient='records') |
|
|
|
print("json",json_string) |
|
|
|
|
|
# jobs.to_csv("shinob-jobs-report.csv", quoting=csv.QUOTE_NONNUMERIC, escapechar="\\", index=False, sep='|' ) |
|
|
|
return json_string |
|
|
|
def writeFile( variable_value): |
|
|
|
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") |
|
|
|
filename = f"shinobi-jobs-report.json" |
|
|
|
with open(filename, "w") as f: |
|
|
|
f.write(str(variable_value)) |
|
|
|
def read(): |
|
|
|
filename = "shinobi-jobs-report.json" |
|
|
|
try: |
|
|
|
with open(filename, "r") as f: |
|
|
|
return f.read() |
|
|
|
except FileNotFoundError: |
|
|
|
print(f"Error: File '{filename}' not found.") |
|
|
|
return None |
|
|
|
#thing = dowork() |
|
|
|
#print("thing: ",thing) |
|
|
|
#writeFile(thing)
|
|
|