Hack to save page as html or pdf

I am using streamlit for a number of experiment debug purposes and would like to be able to share the results internally with others. I was thinking of running the report, allowing for text inputs from users (comments on an experiment) then a button to save page as html and export to a local directory. I know this functionality doesn’t exist currently but has anyone found a hack for it?

Hi @kotte, welcome to the Streamlit community!

With the amount of things that are dynamically generated, I think this would be pretty difficult to engineer. You could start with the browser tools…right-click and save as HTML, or use the print menu and choose printing to PDF?

Hey @randyzwitch, thanks! I just discovered this last week and already have put together some really great apps for our internal teams.

Indeed, I have been doing print + save as pdf which works relatively well but, to increase adoption amongst non-technical folks, I’d like to make that a little bit easier. I’m curious if you could use something like https://pyautogui.readthedocs.io/en/latest/ or a shell script that is triggered when a user clicks a button. Also, I’m open to other suggestions but the goal is really to be able to share these apps with a greater audience and reduce the friction.

  • Kevin