Skip to content

Commit

Permalink
Merge pull request #315 from lalalaurentiu/main
Browse files Browse the repository at this point in the history
Fixed Allianx and BAT scraper
  • Loading branch information
lalalaurentiu authored Nov 22, 2023
2 parents 10e6270 + 2d457a9 commit 97221bd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
9 changes: 8 additions & 1 deletion sites/allianz.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@
id = uuid.uuid4()
job_title = element.find("a").text.strip()
job_link = "https://careers.allianz.com" + element.find("a").get("href")
location = element.find("div", {"class": "location"}).find("div").text.strip()
remote = []

if "RO" in location:
remote.append("Hybrid")

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

#Afisam numarul de total de joburi
Expand Down
40 changes: 24 additions & 16 deletions sites/bat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from scraper_peviitor import Scraper, loadingData, Rules
import uuid
from utils import (translate_city)
from getCounty import get_county, remove_diacritics
import json

url = "https://careers.bat.com/search-jobs/results?ActiveFacetID=0&CurrentPage=1&RecordsPerPage=1000&Distance=100&RadiusUnitType=0&Location=Romania&Latitude=46.00000&Longitude=25.00000&ShowRadius=False&IsPagination=False&FacetType=0&SearchResultsModuleName=Search+Results&SearchFiltersModuleName=Search+Filters&SortCriteria=0&SortDirection=0&SearchType=1&LocationType=2&LocationPath=798549&OrganizationIds=1045&ResultsType=0"
Expand All @@ -21,34 +22,41 @@
finalJobs = list()

for job in jobs:
id = uuid.uuid4()
job_title = job.find("h3").text
job_link = "https://careers.bat.com" + job.find("a").get("href")
city = job.find("span", {"class": "job-location"}).text.split(",")[0].strip()

finalJobs.append(
{
"id": str(id),
"job_title": job_title,
"job_link": job_link,
"company": company.get("company"),
"country": "Romania",
"city": city,
}
city = translate_city(
remove_diacritics(
job.find("span", {"class": "job-location"}
).text.split(",")[0].strip()
)
)
county = get_county(city)

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

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


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

logoUrl = "https://cdn.radancy.eu/company/1045/v2_0/img/temporary/shared/bat-logo.svg"

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

0 comments on commit 97221bd

Please sign in to comment.