使用Python获取财务数据

我设法编写了一些Python代码和Selenium,它们可以导航到包含某些表中财务数据的网页。

我希望能够提取数据并将其放入excel。

这些表似乎是基于html的表代码,如下所示:

                <tr>
                <td class="bc2T bc2gt">Last update</td>
                <td class="bc2V bc2D">03/15/2018</td><td class="bc2V bc2D">03/14/2019</td><td class="bc2V bc2D">03/12/2020</td><td class="bc2V bc2D" style="background-color:#DEFEFE;">05/22/2020</td><td class="bc2V bc2D" style="background-color:#DEFEFE;">05/20/2020</td><td class="bc2V bc2D" style="background-color:#DEFEFE;">05/18/2020</td> 
            </tr>
    </table>

The table has the following class name: <table class='BordCollapseYear2' style="margin-right:20px; font-size:12px; width:100%;" cellspacing=0>

有什么办法可以提取这些数据?理想情况下,我希望它是动态的,以便它可以提取不同公司的信息。

我以前从未使用过它,但是我看过几次提到BeautifulSoup库。

https://www.marketscreener.com/MICROSOFT-CORPORATION-4835/financials/

以微软为例。我想提取损益表数据,资产负债表等。