Skip to content

Commit

Permalink
repare and readd cleverTech
Browse files Browse the repository at this point in the history
  • Loading branch information
andreireporter13 committed Jul 4, 2023
1 parent cbf8d72 commit d25e171
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 44 deletions.
3 changes: 1 addition & 2 deletions sites/A_OOI_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
'proctergamble_scraper.py',
'globallogic_scraper.py',
'bittnet_scraper.py',
'kenvue_scraper.py',
'clevertech_scraper.py']
'kenvue_scraper.py']

path = os.path.dirname(os.path.abspath(__file__))

Expand Down
53 changes: 50 additions & 3 deletions sites/clevertech_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from L_00_logo import update_logo
#
import requests
from bs4 import BeautifulSoup
#
import uuid

Expand All @@ -19,10 +20,56 @@ def get_id() -> str:
... get id from site.
'''

response = requests.head(url='https://clevertech.biz/jobs',
response = requests.get(url='https://clevertech.biz/jobs',
headers=DEFAULT_HEADERS)
soup = BeautifulSoup(response.text, 'lxml')

return response.headers
# search scr script
scr_script_id = str(soup.find_all("script", src=True)[-1]).split('/')[-3]

return scr_script_id

print(get_id())

def collect_data_from_clevertech() -> list[dict]:
'''
... get data from clever tech with one request to json data.
Need more attention, because may be cause errros.
'''

idx = get_id()
response = requests.get(url=f'https://clevertech.biz/_next/data/{idx}/jobs/apply.json',
headers=DEFAULT_HEADERS).json()

lst_with_data = []
for job in response['pageProps']['activeJobs']:
slug = job['slug']
title = job['name']

lst_with_data.append({
"id": str(uuid.uuid4()),
"job_title": title,
"job_link": f'https://clevertech.biz/remote-jobs/{slug}',
"company": "clevertech",
"country": "Romania",
"city": "Remote"
})

return lst_with_data


@update_peviitor_api
def scrape_and_update_peviitor(company_name, data_list):
"""
Update data on peviitor API!
"""

return data_list


company_name = 'clevertech'
data_list = collect_data_from_clevertech()
scrape_and_update_peviitor(company_name, data_list)

print(update_logo('clevertech',
"https://clevertech.biz/_next/static/media/ct-logo-greyred.cc64d432.svg"
))
39 changes: 0 additions & 39 deletions sites/kenvue_scraper.py

This file was deleted.

0 comments on commit d25e171

Please sign in to comment.