Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing tags when converting tables #20

Open
Quadsam opened this issue Jan 15, 2023 · 3 comments
Open

Missing tags when converting tables #20

Quadsam opened this issue Jan 15, 2023 · 3 comments

Comments

@Quadsam
Copy link

Quadsam commented Jan 15, 2023

When using the convert_tables() function the output is missing some tags.

Take the example from the readme:

import html_to_json

html_string = """<table>
    <tr>
        <th>#</th>
        <th>Malware</th>
        <th>MD5</th>
        <th>Date Added</th>
    </tr>

    <tr>
        <td>25548</td>
        <td><a href="/stats/DarkComet/">DarkComet</a></td>
        <td><a href="/config/034a37b2a2307f876adc9538986d7b86">034a37b2a2307f876adc9538986d7b86</a></td>
        <td>July 9, 2018, 6:25 a.m.</td>
    </tr>
    
    <tr>
        <td>25547</td>
        <td><a href="/stats/DarkComet/">DarkComet</a></td>
        <td><a href="/config/706eeefbac3de4d58b27d964173999c3">706eeefbac3de4d58b27d964173999c3</a></td>
        <td>July 7, 2018, 6:25 a.m.</td>
    </tr></table>"""
tables = html_to_json.convert_tables(html_string)
print(tables)

Output

[
    [
        {
            "#": "25548",
            "Malware": "DarkComet",
            "MD5": "034a37b2a2307f876adc9538986d7b86",
            "Date Added": "July 9, 2018, 6:25 a.m."
        }, {
            "#": "25547",
            "Malware": "DarkComet",
            "MD5": "706eeefbac3de4d58b27d964173999c3",
            "Date Added": "July 7, 2018, 6:25 a.m."
        }
    ]
]

The result is missing <a> tags and their href= attributes.

@fhightower
Copy link
Owner

Sorry... I never replied to this. Thanks for raising this @Quadsam - looks like that's something we should add. If you're up for it, I'd appreciate a PR to help fix this, but otherwise I will keep it in my backlog and get to it when I can.

@Quadsam
Copy link
Author

Quadsam commented May 12, 2023

thanks for the response, I will try to implement this but I've got a busy schedule for the next week so it may take a while.

@fhightower
Copy link
Owner

Just want to follow up on this - I have a lot of demands on my time at the moment and won't be able to work on this without sponsorship. If you're using this python package for profit, please consider sponsoring me. Thanks!

Regardless, I'll try to swing back to this project and fix some of these issues sometime before the end of the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants