Extract the information represented in any HTML table
Project description
Tablextract
This Python 3 library extracts the information represented in any HTML table. This project has been developed in the context of the paper TOMATE: On extracting information from HTML tables
.
How to install
You can install this library via pip using:
pip install tablextract
Usage
>>> from pprint import pprint
>>> from tablextract import tables
>>>
>>> ts = tables('https://en.wikipedia.org/wiki/Fiji')
>>> ts
[
Table(url=https://en.wikipedia.org/wiki/Fiji, xpath=.../div[4]/div[1]/table[2]),
Table(url=https://en.wikipedia.org/wiki/Fiji, xpath=.../div[4]/div[1]/table[3]),
Table(url=https://en.wikipedia.org/wiki/Fiji, xpath=.../div[4]/div[1]/table[4])
]
>>> ts[0].record
[
{'Confederacy': 'Burebasaga', 'Chief': 'Ro Teimumu Vuikaba Kepa'},
{'Confederacy': 'Kubuna', 'Chief': 'Vacant'},
{'Confederacy': 'Tovata', 'Chief': 'Ratu Naiqama Tawake Lalabalavu'}
]
>>> ts[2].record
[
{'English': 'Hello/hi', 'Fijian': 'bula', 'Fiji Hindi': 'नमस्ते (namaste)'},
{'English': 'Good morning', 'Fijian': 'yadra (Pronounced Yandra)', 'Fiji Hindi': 'सुप्रभात (suprabhat)'},
{'English': 'Goodbye', 'Fijian': 'moce (Pronounced Mothe)', 'Fiji Hindi': 'अलविदा (alavidā)'}
]
Further information will be written soon.
Changes
v1
Released on Jan 24, 2019.
- Before using Selenium, geckodriver is automatically downloaded for Linux, Windows and Mac OS.
- The Firefox process is closed automatically when the process ends.
- Geckodriver
quit
is called instead ofclose
. - Side-projects has been moved from this core project to tablextract-server and datamart.
- Fixed project imports and setup
- More readable Table objects
v0
Released on Jan 22, 2019.
- Initial package upload.
- Removed side projects to tablextractserver and datamart
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tablextract-1.0.17.tar.gz
(14.3 kB
view hashes)
Built Distribution
Close
Hashes for tablextract-1.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e498709c15c34dfde7c5c85ba0577f6d5fe4dd8e3d235a60f8ae463881df25b |
|
MD5 | 9046dc6cc97e905f47b3a6306164b1f6 |
|
BLAKE2b-256 | 8e91c201c0008dfc478655e53a3aa6eb76451f8bd361430fd0d7b35732b293a9 |