I installed packages and advanced the first part of loop; the provided code contains a loop that iterates through election years, starting from 2 and going up to, but not including, 27.
The WebDriver (driver) opens a base URL (url_base). The code interacts with a series of dropdowns (dropdown_paths_1) using XPaths to navigate to the desired election. An XPath is constructed based on the loop variable div to locate and click on the specific election element. The code retrieves the text from the selected election element and appends it to the eleccion_year_list. A short pause (time.sleep(1)) is added to allow the webpage to load. Another set of dropdowns (dropdown_paths_2) is interacted with, clicking on each dropdown element to perform further actions on the webpage.
I installed packages and advanced the first part of loop; the provided code contains a loop that iterates through election years, starting from 2 and going up to, but not including, 27. The WebDriver (driver) opens a base URL (url_base). The code interacts with a series of dropdowns (dropdown_paths_1) using XPaths to navigate to the desired election. An XPath is constructed based on the loop variable div to locate and click on the specific election element. The code retrieves the text from the selected election element and appends it to the eleccion_year_list. A short pause (time.sleep(1)) is added to allow the webpage to load. Another set of dropdowns (dropdown_paths_2) is interacted with, clicking on each dropdown element to perform further actions on the webpage.