html-table-parser-python3.5+
This module consists of just one small class. Its purpose is to parse HTML tables without help of external modules. Everything I use is part of python 3. Instead of installing this module, you can just copy the class located in parse.py into your own code.
How to use
Probably best shown by example using pyenv for convenience:
pyenv local
python ./example_of_usage.py
The parser returns a nested lists of tables containing rows containing cells as strings. Tags in cells are stripped and the tags text content is joined. The console output for parsing all tables on the twitter home page looks like this:
>>>
[[['', 'Anmelden']],
[['Land', 'Code', 'Für Kunden von'],
['Vereinigte Staaten', '40404', '(beliebig)'],
['Kanada', '21212', '(beliebig)'],
...
['3424486444', 'Vodafone'],
['Zeige SMS-Kurzwahlen für andere Länder']]]
CLI
There is also a command line interface which you can use directly to generate a CSV:
./html_table_converter -u http://web.archive.org/web/20180524092138/http://metal-train.de/index.php/fahrplan.html -o metaltrain
If you need help for the supported parameters append -h:
./html_table_converter -h
Tests
A set of rudimentary tests have been implemented using Python's built-in unittest framework. Tests must be ran on Python 3.X. To run, use the following command:
python -m unittest
Metadata
Release files for html-table-parser-python3 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| html_table_parser_python3-0.3.1.tar.gz | 15.3 kB | Without provenance | Details for html_table_parser_python3-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| html_table_parser_python3-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for html_table_parser_python3-0.3.1-py3-none-any.whl |
Total release size: 30.8 kB
Release files / html_table_parser_python3-0.3.1.tar.gz
| Download URL | html_table_parser_python3-0.3.1.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e33c436c1011501b8d3ef95114587580e8e923ff59ee04903646654608369f4
|
|
BLAKE2b-256 checksum How to use checksums |
8594a6760c2f347bf8b19acf330d37fce9ba00572948d672edc74ecc388244a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Release files / html_table_parser_python3-0.3.1-py3-none-any.whl
| Download URL | html_table_parser_python3-0.3.1-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f909c25fdb592d0ab9a535405712ab8aa4a0c0e7402583bd7650dd94b7fddb4e
|
|
BLAKE2b-256 checksum How to use checksums |
92b63d57fae8305d0f8ec2f8b378262eb31162acebd66d41dce295601a8c4076
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Security for html-table-parser-python3 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.