bcicen / wikitables

Import tables from any Wikipedia article as a dataset in Python
MIT License
292 stars 34 forks source link

Exception when Parsing Tables without Header #14

Closed k----n closed 5 years ago

k----n commented 6 years ago

To reproduce try to extract: https://en.wikipedia.org/wiki/%22Isis%22_of_the_Suebi

I'm not sure how you would like to deal with this case.

Let me know and I can submit a PR.

bcicen commented 6 years ago

_find_header_row should return None if there are no tr nodes found

then perhaps a fallback to both _find_header_flat and _find_header_row coming up empty can be a placeholder header equal to the length of td elements per row; e.g ['column1','column2'...]

bcicen commented 5 years ago

Closing this for now -- a fallback now exists for headerless tables (though the example given here has no rows or structure to be compatible)