I’m trying to parse emails and convert tables within them into pandas dataframes. Since some of the emails are multipart, I took some code from this answer. The following code works fine but it breaks with multipart/related emails (no tables are found). Here’s the header of one of the multipart/related emails: Any ideas? Thanks Answer you want to parse text/html