Recommand · May 26, 2021 0

Get attached files from email using BeautifouSoup

Im looking forward to get the attached files from an email. I can only get the email info through BeautifulSoup.

I read the emails like that:

s3 = boto3.client('s3')
data = s3.get_object(Bucket = bucketname, key=itemname)
contents = data['Body'].read()
soup = BeautifulSoup(contents, 'html.parser')

Where itemname is the email saved in the AWS Bucket

¿¿Is there any way to get the attached files from the soup??

Thank you so much¡¡