Answer the question
In order to leave comments, you need to log in
Download pdf file from download link in python?
There is a link https://www.cian.ru/export/pdf/rent/flat/262482762/ . If you click on it, a page will open that will start downloading the PDF file and the page will instantly close. Is there a way to download this file to the right folder via python?
I tried to send a get request using the requests library, it gives only a 200 response, the file is not downloaded.
Answer the question
In order to leave comments, you need to log in
I tried to send a get request using the requests library, it gives only a 200 response, the file is not downloaded.
r = requests.get('https://www.cian.ru/export/pdf/rent/flat/262482762/')
with open('file.pdf', 'wb') as f:
f.write(r.content)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question