In selenium, how can I go through a list and click a button one by one till the end?

Viewed 63

I'm trying to automate a google takeout for a few gmail accounts. I'm currently stuck on when the export is ready to download. Google keeps splitting up the zips into 3-8 files. Even though I request a 50 GB export and the total size of the gmail account is maxed out at 30 gb. So I'm not sure why it keeps splitting it, but anyways. A pop up appears with a bunch of download links. How can I code selenium in python to be able to go through the list and click all elements that are there? enter image description here

Any help?

1 Answers

You'd do something like this.

elems = driver.find_elements_by_xpath("//a[@aria-label='Download']")
for elem in elems:
    elem.click()
    #driver.back()
Related