Skip to content

Commit

Permalink
Fixed atpgroup company name
Browse files Browse the repository at this point in the history
  • Loading branch information
RaresCode committed Dec 14, 2023
1 parent 1a8630b commit a45ec16
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
72 changes: 72 additions & 0 deletions sites/atpgroup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
#
#
# atpgroup > https://atp-group.ro/cariere/


from sites.website_scraper_bs4 import BS4Scraper

class atpgroupScraper(BS4Scraper):

"""
A class for scraping job data from atpgroup website.
"""
url = 'https://atp-group.ro/cariere/'
url_logo = 'https://atp-group.ro/wp-content/uploads/2022/09/logo.svg'
company_name = 'atpgroup'

def __init__(self):
"""
Initialize the BS4Scraper class.
"""
super().__init__(self.company_name, self.url_logo)

def get_response(self):
self.get_content(self.url)

def scrape_jobs(self):
"""
Scrape job data from atpgroup website.
"""

job_elements = self.get_jobs_elements('css_', "div.elementor-element.elementor-element-63afff4.elementor-widget.elementor-widget-theme-post-title.elementor-page-title.elementor-widget-heading > div > h3 > a")
# job_location_elements = self.get_jobs_elements('class_', 'elementor-post-info__terms-list-item')
job_location_elements = self.get_jobs_elements('class_', 'elementor-icon-list-items elementor-post-info')

self.job_cities = []

for city in self.get_jobs_details_text(job_location_elements):
if city.split("Companie:")[0].replace("Locație: ", "") == '':
self.job_cities.append("Romania")
else:
self.job_cities.append(city.split("Companie:")[0].replace("Locație: ", ""))

self.job_titles = self.get_jobs_details_text(job_elements)
# self.job_cities = self.get_jobs_details_text(job_location_elements)
self.job_urls = self.get_jobs_details_href(job_elements)

self.format_data()

def sent_to_future(self):
self.send_to_viitor()

def return_data(self):
self.get_response()
self.scrape_jobs()
return self.formatted_data, self.company_name

def format_data(self):
"""
Iterate over all job details and send to the create jobs dictionary.
"""
for job_title, job_url, job_city in zip(self.job_titles, self.job_urls, self.job_cities):
self.create_jobs_dict(job_title, job_url, "România", job_city)

if __name__ == "__main__":
atpgroup = atpgroupScraper()
atpgroup.get_response()
atpgroup.scrape_jobs()
atpgroup.sent_to_future()



2 changes: 1 addition & 1 deletion tests/module_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
'autosiena': 'autosienaScraper',
'autonet': 'autonetScraper',
'autoclass': 'autoclassScraper',
'atp-group': 'atpgroupScraper',
'atpgroup': 'atpgroupScraper',
'artvertising': 'artvertisingScraper',
# 'apavital': 'apavitalScraper',
'anahr': 'anahrScraper',
Expand Down

0 comments on commit a45ec16

Please sign in to comment.