[IPython-dev] No code in the exported HTML

Lee Chaplin lchaplin13 at gmail.com
Tue Jul 23 22:26:59 EDT 2013


Thanks Matthias, I will have to study more about nbconvert...
For the moment (and for others that might look for a solution) I managed to
find a quick and dirty solution in Python using BeautifulSoup, something
like:
soup = BeautifulSoup(data_read) # data_read = the IPyNB static saved page
for divin in soup.find_all("div", { "class" : "input hbox" }):
    divin.extract()
for divout in soup.find_all("div", { "class" : "prompt output_prompt" }):
    divout.string.replace_with("")
data_write = soup.renderContents()

Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130724/251771df/attachment.html>


More information about the IPython-dev mailing list