Iterate over multiple URLs/links on page to download specific link on next page

I have searched extensively, but I am unsure how to approach this issue.

I have a webpage (requires logging in) that contains a list of multiple samples. There is a link called "details" next to each sample. The webpage that opens on clicking "details" contains a link "complete data" for that sample, enabling me to download a file.

Since there are thousands of samples, it is too time consuming to go through each "details" link to click the "complete data" link for the file. Is there a way to automatically download the "complete data" link data when situated at the original webpage containing the list of samples?

Any help would be greatly appreciated