Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Inetum scraper #252

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions sites/inetum.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from scraper_peviitor import Scraper, Rules, loadingData
import uuid
import json
from getCounty import get_county
from utils import translate_city, acurate_city_and_county

url = "https://www.inetum.com/en/jobs?f%5B0%5D=region%3A1068"

Expand All @@ -21,32 +22,41 @@
jobs = rules.getTags("div", {"class": "node node-job node-teaser"})

for job in jobs:
id = uuid.uuid4()
job_title = job.find("h3", {"class":"card-title"}).text.strip()
job_link = "https://www.inetum.com" + job.find("a").get("href")
city = job.find("p", {"class": "card-text"}).text.split("-")[-1].strip()
city = translate_city(job.find("p", {"class": "card-text"}).text.split("-")[-1].split("/")[0].strip())
county = get_county(city)
remote = []

jobs_types = ["Remote", "Hybrid"]


for types in jobs_types:
if types in job.find("p", {"class": "card-text"}).text.split("-")[-1].strip():
remote.append(types)

finalJobs.append({
"id": str(id),
"job_title": job_title,
"job_link": job_link,
"company": company.get("company"),
"country": "Romania",
"city": city
"city": city,
"county": county,
"remote": remote,
})

print(json.dumps(finalJobs, indent=4))

loadingData(finalJobs, company.get("company"))
# loadingData(finalJobs, company.get("company"))

logoUrl = "https://vtlogo.com/wp-content/uploads/2021/05/inetum-vector-logo-small.png"
# logoUrl = "https://vtlogo.com/wp-content/uploads/2021/05/inetum-vector-logo-small.png"

scraper.session.headers.update({
"Content-Type": "application/json",
})
scraper.post( "https://api.peviitor.ro/v1/logo/add/" ,json.dumps([
{
"id":company.get("company"),
"logo":logoUrl
}
]))
# scraper.session.headers.update({
# "Content-Type": "application/json",
# })
# scraper.post( "https://api.peviitor.ro/v1/logo/add/" ,json.dumps([
# {
# "id":company.get("company"),
# "logo":logoUrl
# }
# ]))