How to download a file by indirect reference?

Lord, help solve the problem:
There is a website where you need to download a csv file for further data manipulation.
File link is not direct, but such
CSV_URL = f'somesite.ru/?export_excel=Y&FILTER%5BUF_WAREHOUSE%5D=1&FILTER%5BUF_SHIPPING_DATE%5D%5Bstart%5D%5B0%5D={date}&FILTER%5BUF_SHIPPING_DATE%5D%5Bfinish%5D%5B0%5D={date}'

Clicking that link starts the download a csv with the required sampling parameters.
At the moment I swing through Selenium, but I want to do a little blood through requests.
When working through Selenium I point download.default_directory": ROOT_PATH and the file is downloaded where necessary.

Globally the problem is the following: I the script is packaged in .exe, but its correct operation should always carry with you the driver for chrome. It happens that on some PC version of chrome is different and nothing works:) And if you can solve this problem by using requests, everything should be OK
April 19th 20 at 12:16
3 answers
April 19th 20 at 12:18
Open the debug console of the browser and view the query that makes the browser to download the file. Right-click and copy the CURL command to execute this query from the command line.
In terms of the scant information that you have provided (no examples) you more will tell nothing.
Most interesting is that in the Network tab of chrome console, nothing appears when you click the link. Example, can not give because this is a private corporate facility and no account with the necessary access rights, nothing will work -) - Johnny_DAmore commented on April 19th 20 at 12:21
@Johnny_DAmore, Well, you can see what the code is doing by clicking on the link.
May be all the information it needs when the page is rendered, and the link only initiates the procedure of filtration and preservation. - adela.Sauer95 commented on April 19th 20 at 12:24
Generally interesting a page is. If a user on the site disabled all filters, press the button with the link
https://somesite.ru/delivery/?export_excel=Y
Downloaded the whole table in csv format, which is already loaded on the table.
5e983ba468ebe942312476.png

If you set some filter like date, link, the button changes to
https://somesite/delivery/?export_excel=Y&FILTER%5BUF_SHIPPING_DATE%5D%5Bstart%5D%5B0%5D=16.04.2020&FILTER%5BUF_SHIPPING_DATE%5D%5Bfinish%5D%5B0%5D=16.04.2020


But if you replace the dates FROM and TO in the link manually or programmatically( as I now work), then download the file for the desired date, regardless of current page content - Johnny_DAmore commented on April 19th 20 at 12:27
@Johnny_DAmore, well I can tell you... Javascript is a fully Turing programming language. It is possible to code anything. You - too narrow a keyhole for productive research problem. - adela.Sauer95 commented on April 19th 20 at 12:30
April 19th 20 at 12:20
normal get request

and then r.raw-write binary mode
April 19th 20 at 12:22
Isn't that going to work?

r = requests.get(CSV_URL)

with open('result.csv', 'wb') as f:
 f.write(r.content)

Find more questions by tags Python