import TableParse
import csv
html='
| Heading | Another Heading |
|---|
| row 1, cell 1 | row 1, cell 2 |
| row 2, cell 1 | row 2, cell 2 |
'
nodes=TableParse.parse(html)
c=csv.writer(open('data', 'w'))
for i in range(0,len(nodes)):
c.writerow(nodes[i])
'''
data contains:
Heading,Another Heading
"row 1, cell 1","row 1, cell 2"
"row 2, cell 1","row 2, cell 2"
'''