- https://github.com/adelevie/open-internet-order-footnotes
- https://raw.githubusercontent.com/adelevie/open-internet-order-footnotes/master/word/footnotes.xml
soup = BeautifulSoup(open("filename").read())import readline; print '\n'.join([str(readline.get_history_item(i)) for i in range(readline.get_current_history_length())])- print history of python shell
# find history of python shell commands
import readline
for i in range(readline.get_current_history_length()):
print readline.get_history_item(i)
# find history of python shell commands, in one line
import readline; print '\n'.join([str(readline.get_history_item(i)) for i in range(readline.get_current_history_length())])
from BeautifulSoup import BeautifulSoup
import urllib2
open urllib2.open()
docurl = "https://raw.githubusercontent.com/adelevie/open-internet-order-footnotes/master/word/footnotes.xml"
page = urllib2.urlopen(docurl)
soup = BeautifulSoup(page)
print soup.prettify()
docurl = "https://raw.githubusercontent.com/adelevie/open-internet-order-footnotes/master/word/footnotes.xml"
page = urllib2.urlopen(docurl)
soup = BeautifulSoup(page)
footnotes = soup.findAll('w:footnote')
for f in footnotes:
print f['w:id']
f.text
# Since we have name spaces, we need to use 'findAll' instead of dot notation.
footnotes = soup.findAll('w:footnote')