0

I am currently working on a code that downloads an excel file from a website. The respective file is actually hidden behind an Export button (see website: https://www.amundietf.co.uk/retail/product/view/LU1437018838). However, I have already identified the link behind which is the following: https://www.amundietf.co.uk/retail/ezaap/service/ExportDataProductSheet/Fwd/en-GB/718/LU1437018838/object/export/repartition?idFonctionnel=export-repartition-pie-etf&exportIndex=3&hasDisclaimer=1. Since the link does not directly guide to the file but rather executes some Java widget, I am not able to download the file via python. I have tried the folling code:

import re
import requests
link = 'https://www.amundietf.co.uk/retail/ezaap/service/ExportDataProductSheet/Fwd/en-GB/718/LU1437018838/object/export/repartition?idFonctionnel=export-repartition-pie-etf&exportIndex=3&hasDisclaimer=1'

r = requests.get(link, verify= False)

However, I am not able to connect to the file. Does somebody has an idea for doing this?

LFRBX
  • 1
  • Does this answer your question? [Download large file in python with requests](https://stackoverflow.com/questions/16694907/download-large-file-in-python-with-requests) This works perfectly with the URL you identified. – buran Feb 07 '22 at 09:46

1 Answers1

0

I would recommend using HTML:

<html lang=en>
  <body>
    <a href="https://file-examples-com.github.io/uploads/2017/02/file_example_XLSX_10.xlsx" target="_blank">Click here to download</a>
  </body>
</html>

In the href attribute to tag, you can put the path to your own excel file. I used an external link to an example file I found on google. To open in new tab, use target="_blank" as attribute to .

Hope it works!

norway-yv
  • 222
  • 2
  • 12