'Webscraping site that downloads a file in Python

I'm trying to scrape a table from a website. I obviously get the XPATH of the table to use in the Selenium driver - but the website already produces a file which we can download of the same table. I click on an icon and it opens a SAVE AS dialog box.

Using selenium, how can I just download this file? How do I just save it directly?



Solution 1:[1]

According to older posts, some degree of input is emulated. (using pyautogui). Probably just an enter key on keyboard.

https://stackoverflow.com/a/58432097/19042045

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Neo