I’m trying to scrape this website: https://www.lavoro.gov.it/ and I have a problem when i search for a keyword in the searchbar and I get to the following page:
Now as you can see, I’m trying to cicle the pages in the website by auto-clicking with selenium on the arrow, but whenever I copy an XPATH linked to the arrow I get the following: #it-block-italiagov-content and the exception
[DEBUG] Exception: 'list' object has no attribute 'click'
Here is my code, I’ve tried all differents XPATH:
try:
next_page_link = driver.find_elements(By.XPATH, "")
# search_results_url = next_page_link.get_attribute("href")
# driver.get(search_results_url) # <--- open next page with results using URL
next_page_link.click() # <--- or click link
except Exception as e:
print('[DEBUG] Exception:', e)
print('[DEBUG] break')
#input('Press ENTER to continue')
break # exit loop
Is there a way to bypass this?