I can't get the photo metadata

Viewed 34
1 Answers

I'm not sure why you are using BeautifulSoup: that is a parser for html documents. In your case, response is a binary stream. This is one way to get the Created Date:

import requests

r = requests.get('https://s3.amazonaws.com/world.growtopiagame.com/start.png', stream=True)
created_date = str(r.content).split('x00%tEXt')[1].split('+00:00')[0].replace('\\x00', ' ')
modified_date = str(r.content).split('x00%tEXt')[2].split('+00:00')[0].replace('\\x00', ' ')
print(created_date)
print(modified_date)

Response in terminal:

date:create 2020-09-13T12:56:44
date:modify 2020-09-13T12:56:44

Requests documentation can be found at https://requests.readthedocs.io/en/latest/

Related