Skip to content

Commit

Permalink
Fixed nielseniq jobs not picked up if only 1 page
Browse files Browse the repository at this point in the history
  • Loading branch information
RaresCode committed Dec 27, 2023
1 parent 128e43d commit 7ac019e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sites/nielseniq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 7ac019e

Please sign in to comment.