1for body in message.find_all('div', {'class': 'body'}):
2 # grab div by class name
3 if body.find('div', {'class': 'date'}):
4 text = body.find('div', {'class': 'date'})
5 # find div by 'title' attribute
6 title = text.get('title', 'No title attribute')
7 print(title)