A better trick is to open the chat on the desktop browser, then do something so it continuously scrolls up until the whole chat history is loaded. You can use a loop or you can put something heavy on the pageup key.
When it's ready, open up the web inspector and copy the whole HTML. It can be huge. After you paste it, make sure the beginning and end are there. It might be larger than the clipboard buffer. If it was incomplete when copying from one browser, try another.
If on X11, I think primary selection can be unlimited in theory, but the browser might not support it in the web inspector. If you want to try that, you'd have to use the console to print the html to it or to the page (more messy, but more likely to work). Then highlight and paste with middleclick somewhere.
Of course, if the web inspector has some type of "save DOM to file" feature, then that would be far simpler.