Closed mhkeller closed 9 years ago
Good plan! I've been meaning to revisit and improve this.
Pull request would be awesome, otherwise I'll take a look and see if I can improve it (and the docs & maybe write some tests) later in the month!
PR https://github.com/iaincollins/tabletojson/pull/3 closes this.
The table I'm trying to convert has a
thead
andtbody
element so children doesn't go down enough levels. Changing.children
to find will fix this. Not sure if it has any drawbacks. The only thing I can think of is if you have tables within your table. But you might have other problems if that's the case.There could also be some type of check that looks for
thead
andtbody
if they exist and then use.children
. That would save some computing energy in looping over alltr
s to extract theth
s.I can do a pull request on changing to children if you like.