https://github.com/alexdelorenzo/html_wrapper
HTML parser with lxml backend. Implements subset of BeautifulSoup API
https://github.com/alexdelorenzo/html_wrapper
beautifulsoup-api html html-wrapper python3
Last synced: 3 months ago
JSON representation
HTML parser with lxml backend. Implements subset of BeautifulSoup API
- Host: GitHub
- URL: https://github.com/alexdelorenzo/html_wrapper
- Owner: alexdelorenzo
- License: agpl-3.0
- Created: 2016-09-28T19:48:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T05:40:32.000Z (over 3 years ago)
- Last Synced: 2025-02-13T21:19:30.276Z (4 months ago)
- Topics: beautifulsoup-api, html, html-wrapper, python3
- Language: Python
- Homepage: https://alexdelorenzo.dev
- Size: 49.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html_wrapper
`html_wrapper` implements a small subset of the `BeautifulSoup4` API. It can be anywhere from 10x-100x faster than `bs4` for some use cases.
## Installation
`python3 -m pip install html_wrapper`## Example
It's faster to instantiate and parse HTML. Suits my needs.```python3
In [1]: from html_wrapper import HtmlWrapperIn [2]: from bs4 import BeautifulSoup
In [3]: from requests import get
In [4]: html: bytes = get("https://en.wikipedia.org/wiki/HTML").content
In [5]: %timeit HtmlWrapper(html).text
23.4 ms ± 563 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)In [6]: %timeit BeautifulSoup(html).text
190 ms ± 29.3 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
```## License
See `LICENSE`