From 7ac019e8f0d77f231b4c0113bec3ec5e1999b187 Mon Sep 17 00:00:00 2001 From: Rarescode Date: Wed, 27 Dec 2023 18:29:33 +0200 Subject: [PATCH] Fixed nielseniq jobs not picked up if only 1 page --- sites/nielseniq.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sites/nielseniq.py b/sites/nielseniq.py index 75465751b0..c94cb60e8d 100644 --- a/sites/nielseniq.py +++ b/sites/nielseniq.py @@ -50,6 +50,16 @@ def scrape_jobs(self): job_counter = self.get_jobs_details_href(job_counter_element) if job_counter: self.get_content(job_counter[0]) + + # If the initial loop didn't get triggered due to missing next page element + if not job_counter: + job_title_elements = self.get_jobs_elements('class_', 'entry-title') + job_city_elements = self.get_jobs_elements('css_', 'header > div:nth-child(2) > span:nth-child(1)') + job_url_elements = self.get_jobs_elements('class_', 'card-cover-link') + + self.job_titles.extend(self.get_jobs_details_text(job_title_elements)) + self.job_cities.extend(self.get_jobs_details_text(job_city_elements)) + self.job_urls.extend(self.get_jobs_details_href(job_url_elements)) self.format_data()