Skip to content

Create PrettyTables from HTML source #7

@tormaroe

Description

@tormaroe

From Python tutorial:

If you have some data in a string of HTML code using <table>, say in the variable html_string, you can make a PrettyTable of it as follows

from prettytable import from_html
pts = from_html(html_string)

The variable pts will then be a list of PrettyTable objects. There will be one PrettyTable for each <table> in the HTML code.

If you know for a fact that your HTML code will only contain one table, then instead of using from_html to get a list of length one, you can use the from_html_one function which will return just one PrettyTable object directly. If you give from_html_one a string containing several <table>s, it will throw an Exception.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions