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.
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 followsThe 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.