Skip to content

Commit

Permalink
Download dataset button is sometimes a div, sometimes an anchor, so m…
Browse files Browse the repository at this point in the history
…atch both
  • Loading branch information
nuwang committed Oct 7, 2024
1 parent 0e95ffa commit 9118205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion page_perf_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def download_dummy_file(self):
open_download_link = self.driver.find_element(By.XPATH, "//div[@data-index]//div[@data-state='ok' and contains(., 'NA19473.mapped')]")
open_download_link.click()
with SeleniumCustomWait(self.driver, 1200):
download_link = self.driver.find_element(By.XPATH, "//div[@data-index]//div[@data-state='ok' and contains(., 'NA19473.mapped')]//a[@title='Download']")
download_link = self.driver.find_element(By.XPATH, "//div[@data-index]//div[@data-state='ok' and contains(., 'NA19473.mapped')]//*[self::a or self::div][@title='Download']")
all_cookies=self.driver.get_cookies()
cookies_dict = {cookie["name"]: cookie["value"] for cookie in all_cookies}
r = requests.get(download_link.get_attribute("href"), stream=True, cookies=cookies_dict)
Expand Down

0 comments on commit 9118205

Please sign in to comment.