For each row in the table on this page, I would like to click on the ID (e.g. the ID of row 1 is 270516746) and extract/download the information (which does NOT have the same he
You dont have to click with the text visible. You can generate generic xpaths like :
"(//table//td[1])//button[@data-target]"
This will detect all buttons in the first column of the table. So you can go on loop.
count= len(driver.find_elements_by_xpath("(//table//td[1])//button[@data-target]"))
for i in range(count):
driver.find_element_by_xpath("((//table//td[1])//button[@data-target])[" + str(i+1) + "]").click()
# to get text content from pop up window
text = driver.find_element_by_xpath("//div[@class='modal-content']").text
# then click close
driver.find_element_by_xpath("//button[text()='Close']").click()