Skip to content

Commit

Permalink
Merge pull request #311 from lalalaurentiu/main
Browse files Browse the repository at this point in the history
fixet Selgros scraper
  • Loading branch information
lalalaurentiu authored Nov 21, 2023
2 parents 62749a8 + 95b54f0 commit 3b23e87
Showing 1 changed file with 40 additions and 11 deletions.
51 changes: 40 additions & 11 deletions sites/selgros.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
from scraper.Scraper import Scraper
from utils import (publish, publish_logo, create_job, show_jobs)
from getCounty import get_county

company = 'Selgros'
url = 'https://mingle.ro/api/boards/mingle/jobs?q=companyUid~eq~%22selgros%22&page=0&pageSize=1000&sort=modifiedDate~DESC'

scraper = Scraper()
scraper.get_from_url(url, "JSON")

acurate_city = {
"Iasi": {
"city": "Iasi",
"county": "Iasi"
},
}

jobs = []

for job in scraper.markup['data']['results']:
try:
city = job['locations'][0]['name']
except:
city = 'Romania'

jobs.append(create_job(
job_title=job['jobTitle'],
job_link='https://selgros.mingle.ro/ro/embed/apply/' + job['publicUid'],
city=city,
country='Romania',
company=company,
))
locations = job['locations']
cities = []
counties = []
for city in locations:
if "Bucuresti" in city["name"]:
if "Bucuresti" not in cities:
cities.append("Bucuresti")
counties.append("Bucuresti")
else:

county = get_county(city["name"])

if county and county not in counties:
cities.append(city["name"])
counties.append(county)
else:
county = get_county(
city["name"].replace(" ", "-")
)
if county and county not in counties:
cities.append(city["name"].replace(" ", "-"))
counties.append(county)
jobs.append(create_job(
job_title=job['jobTitle'],
job_link='https://selgros.mingle.ro/ro/embed/apply/' + job['publicUid'],
city=cities,
country='Romania',
company=company,
county=counties,
))
except Exception as e:
pass

for version in [1,4]:
publish(version, company, jobs, 'APIKEY')
Expand Down

0 comments on commit 3b23e87

Please sign in to comment.