Answer the question
In order to leave comments, you need to log in
How to download a file from a tag using requests?
There is a button to download photos. In addition, the site generates the tag in this way:
<form method="GET" id="file_link" action="/output/20200702101111557143.jpg">
if req.ok:
img = 'http://color.photofuneditor.com/ceremony'
bot.send_message(message.chat.id, "Идет обработка...")
time.sleep(10)
r = requests.get(img, files={'image': ('my_img.jpg', img.content, 'image/jpg')})
img_file = file('/home/dir/images/', 'wb')
img_file.write(img.content)
img_file.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question