maugenst / tabletojson

An npm module for node.js to convert HTML tables to JSON objects
https://www.npmjs.com/package/tabletojson
MIT License
138 stars 38 forks source link

Table won't parse correctly #9

Closed gfgqtmakia closed 6 years ago

gfgqtmakia commented 8 years ago

https://malwr.com/analysis/NzU2ZjgzYTI5ODUyNDViN2IyYTY1ZTE2N2VmNmVjNzU/

the headers of the File Details table doesn't parse correctly:

[ 
{ '0': 'chrome.exe' },
{ '0': '23040 bytes' },
{ '0': 'PE32 executable (GUI) Intel 80386 Mono/.Net assembly, for MS Windows' },
{ '0': '21e3aeaf76807cf2415be8675e2e19d9' },
{ '0': '073e9964b7b95e705f99d51664450013e90b7f39' },
{ '0': '31537b78b3016fd9da4115cda5ff3f86a5dd696d654db5ab2fe80aa25e3d21e2' },
{ '0': '3fb8d5927df8846eb7704f0d53bbb977d5e09edddea73182fa36caee75a6ded648f283c68f48cf381c42e47a18c0ba72a7532f4e45e01c122ec4e2e1bd7ca988' },
{ '0': 'D0E362B3' },
{ '0': '384:wslUlEvOEJ8xWwYJOMiOBZEdj1567gtwi5HhbQmRvR6JZlbw8hqIusZzZEvd:peEvwIlLMRpcnuH' },
{ '0': 'None matched' },
{ '0': 'Download You need to login' } 
]
iaincollins commented 8 years ago

Thanks for the bug report! It seems like it should be easy enough to add check for a at the same level as a which should work for tables like this. I'll take a look at it Monday.

gfgqtmakia commented 8 years ago

Is it also possible to add support for lists (ul)? E.g. to return

{
    "tables": [...],
    "lists": [...]
}
iaincollins commented 7 years ago

@gfgqtmakia Good idea! Can you open a feature request for that?

It would be a breaking change as would alter the response format (so I'd bump the major version) but is an easy thing to add.

maugenst commented 6 years ago

I'm not able to call the referenced web page. Could you please resend a working link? Since it is not possible to evaluate this issue I would close this Bug.

Related to your request to support lists I opened a FeatureRequest. As Iain said, I think since this is a breaking change I would also go for a major release supporting this.