It's really easy. In the chat context menu, go to Export Chat History. You can then pick what kind of media to export (aside from just the messages themselves). It produces semantically tagged HTML (mostly divs with .date, .from_name, .text, etc, wrapped in a basic head/body tag) in a folder of your choosing which you can then parse with Cheerio, BeautifulSoup, etc.