I am interested in downloading financial statements from the website Morningstar. Here there is an example of a page:
http://financials.morningstar.com/cash-flow/cf.html?t=PIRC®ion=ita&culture=en-US
On the top right there is the export to csv button, and I would like to click it with Python. Pressing inspection, I have this HTML tag:
<div class="exportButton">
<span class="icon_1_span">
<a href="javascript:SRT_stocFund.Export()" class="rf_export">
</a> ==$0
My idea was to use bs4 - BeautifulSoup to parse (not sure at all whether I need to parse it) the page and find the button to click it. Something like:
quote_page = pageURL
page = urlopen(quote_page)
soup = BeautifulSoup(page, "html.parser")
bs = soup.find(href="javascript:SRT_stocFund.Export()", attrs={"class":"rf_export"})
Obviously, this returns nothing. Do you have any suggestion on how could I tell to Python to export the data in the table? I.e. to automate the process of downloading the csv file instead of going on the webpage and doing it on my own.
Thank you very much!!