Skip to content

Commit

Permalink
Merge pull request #252 from lalalaurentiu/main
Browse files Browse the repository at this point in the history
Fixed Inetum scraper
  • Loading branch information
lalalaurentiu authored Nov 12, 2023
2 parents 1472127 + e86c066 commit 4e96b8a
Showing 1 changed file with 26 additions and 16 deletions.
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
# }
# ]))

0 comments on commit 4e96b8a

Please sign in to comment.