I'm trying to automate a download via Selenium using Python. The website I'm trying to download from has multiple options, with each option having a HTML HREF and an Excel HREF. So the site code looks like this:
</ul>
<li><a class="pnid-642 pv-pid-0 pvid-9972 cid-31"> </a>24. Option 24
<ul>
<li><table width='50%'><tr><td width='20%'> </td><td width='50%'>Select type</td><td width='15%'><A title='Html' HREF='/apps/carteras/genera_xsl_v2.0.php?param=RWJybTl4VEV4MnlHc0VSQVd5T1VKV3Q3STg4Rk5oS1RYUDdaa1dFbDhoWkwzam53L3huQzBnPT0='><span class="fa fa-file-code-o fa-2x" aria-hidden="true"'></span></a></td><td width='15%'><A title='Excel' HREF='/apps/carteras/genera_xsl2xls.php?param=RWJybTl4VEV4MnlHc0VSQVd5T1VKV3Q3STg4Rk5oS1RYUDdaa1dFbDhoWkwzam53L3huQzBnPT0='><span class="fa fa-file-excel-o fa-2x" aria-hidden="true"></span></a></td></tr></table></li>
</ul>
<li><a class="pnid-642 pv-pid-0 pvid-9972 cid-31"> </a>25. Option 25
<ul>
<li><table width='50%'><tr><td width='20%'> </td><td width='50%'>Select type<td width='15%'><A title='Html' HREF='/apps/carteras/genera_xsl_v2.0.php?param=RWJybTl4VEV4MnlHc0VSQVd5T1VKVTBSRDZ5aVNsb2JYUDdaa1dFbDhoWkwzam53L3huQzBnPT0='><span class="fa fa-file-code-o fa-2x" aria-hidden="true"'></span></a></td><td width='15%'><A title='Excel' HREF='/apps/carteras/genera_xsl2xls.php?param=RWJybTl4VEV4MnlHc0VSQVd5T1VKVTBSRDZ5aVNsb2JYUDdaa1dFbDhoWkwzam53L3huQzBnPT0='><span class="fa fa-file-excel-o fa-2x" aria-hidden="true"></span></a></td></tr></table></li>
</ul>
I'm trying to automate the download of the Option 25 Excel file, but as you can see the Excel HREF are identical for each option on the website. Is there a way I can use Selenium to download only that Excel file?
Thanks