How can I output an IPython HTML object of the form <IPython.core.display.HTML object>
to a HTML file or PDF file on disk?
You can do something like this:
from IPython.core.display import HTML
a = HTML('<a href="http://example.com">LINK TO THE WEB PAGE</a>')
html = a.data
with open('html_file.html', 'w') as f:
f.write(html)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With