I have a program that generates plots and displays them to the user using matplotlib. I'm now adding a feature that involves an HTML that is generated from some data and modified. I can display this modified HTML using webbrowser.open('file://' + htmlFilePath, new=2, autoraise=False), and it would open in the default browser or whatever browser was configured for webbrowser.
BUT I'd really like to display this html within the matplotlib window that I have running instead of opening a separate browser window. Is there any way to display this HTML to the matplotlib window? Either as a rendered HTML or even just a picture of the HTML page that would be rendered by a browser.
I don't have much code for what I've tried, as most of the research on stackoverflow is showing me how to display a matplotlib plot AS an html for flask/django, meaning PLOT to HTML instead of HTML to PLOT. I don't need to convert my plot to HTML, I need to convert my HTML to some sort of image or numpy array or something like that so that I can display it like ax.imshow(htmlFilePath). Thanks.

pdftohtml. It's a one page view, The format of the pdf needs to be preserved, which is why I don't want to just show the text generated frompdftotext.