Fast HTML5 parser with CSS selectors.
Project description
A fast HTML5 parser with CSS selectors using Modest engine.
Installation
From PyPI using pip:
pip install selectolax
Development version from github:
git clone --recursive https://github.com/rushter/selectolax
cd selectolax
pip install -r requirements_dev.txt
python setup.py install
How to compile selectolax while developing:
make clean
make dev
Examples
from selectolax.parser import HTMLParser
html = "<div><p id=p1><p id=p2><p id=p3><a>link</a><p id=p4><p id=p5>text<p id=p6></div>"
selector = "div > :nth-child(2n+1):not(:has(a))"
for node in HTMLParser(html).css(selector):
print(node.attributes, node.text(), node.tag)
print(node.parent.tag)
print(node.html)
Simple Benchmark
Average of 10 experiments to parse and retrieve URLs from 800 Google SERP pages.
Package |
Time |
Memory (peak) |
---|---|---|
selectolax |
2.38 sec. |
768.11 MB |
lxml |
18.67 sec. |
769.21 MB |
Links
License
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
selectolax-0.2.5.tar.gz
(1.3 MB
view hashes)
Built Distributions
selectolax-0.2.5-cp38-cp38-win32.whl
(551.6 kB
view hashes)
selectolax-0.2.5-cp37-cp37m-win32.whl
(549.4 kB
view hashes)
selectolax-0.2.5-cp36-cp36m-win32.whl
(549.6 kB
view hashes)
selectolax-0.2.5-cp35-cp35m-win32.whl
(548.7 kB
view hashes)
Close
Hashes for selectolax-0.2.5-pp36-pypy36_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5dded61bbcf58d64eea3fb646c42ebb20f4d482413458e223bfae9e116420e5 |
|
MD5 | 350b30a278fb339262c563ce1233bde5 |
|
BLAKE2b-256 | 2298b399731df2d1675d1071a6d4ec18abefea64c2778b832c623d9ae045927f |
Close
Hashes for selectolax-0.2.5-pp36-pypy36_pp73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87cc0495d2c3c7f52e36afa96d3916bdb005a64bbb1e63c080f07361a44c7de |
|
MD5 | a581287064663973ae497e1bada5bb94 |
|
BLAKE2b-256 | a462c17fe1093dbe7a443041163ab611ec1dfb90faa4b978bf29455ec541d3b8 |
Close
Hashes for selectolax-0.2.5-pp36-pypy36_pp73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec5e3be5bbcb2ce5194d80f6783fa221ec619d19af00d828e1e3e40ada09fcff |
|
MD5 | 612e6e14aea7822f9c2ca1ec40712d28 |
|
BLAKE2b-256 | 6a9effa72c1eaf993f7cb5bc907df02b00f2e8af3fbc8be953aeb31e7093ba14 |
Close
Hashes for selectolax-0.2.5-pp36-pypy36_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6ff3c302f8f798f6ca4a98d4a23c9e20452ad977bff26e2545c593cfc8aaa65 |
|
MD5 | 3a8b639cb5e8a663a546a94173f1fdbb |
|
BLAKE2b-256 | df9dd5bf9e8f819fee8f25bc4d51f71c1ff7c4e33e72c7f8633578f466eec4a9 |
Close
Hashes for selectolax-0.2.5-pp27-pypy_73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c44c83dcc7bc008174b27e7ca90999652c81661f8b7796353bac88ce660acda |
|
MD5 | b1ff934391761267deaf5e2bdd1faf42 |
|
BLAKE2b-256 | 8089e105955a1d2e7adb1b057f2aef2adca706ff1986d9f8250e74201997dc5e |
Close
Hashes for selectolax-0.2.5-pp27-pypy_73-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34d99d92dc7d2e91b8c74c5e3af7816eef9805afcb8eb2e23295f11c4cf75ec5 |
|
MD5 | 67d789ab7d90bda656e384c44fe4ec18 |
|
BLAKE2b-256 | 20e916d757153f79c3b8267d45a850628a4176742a93ec2199c137cdfb95a562 |
Close
Hashes for selectolax-0.2.5-pp27-pypy_73-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc46e49214d653c3ebd864e28d46140e52d97863ff9b5f3f475105253a21daa |
|
MD5 | c8a81eca53343093c8292c1f941c8a86 |
|
BLAKE2b-256 | cce65fb686fb057098b53c3825f58466be98420ec1645c96d72ef69f2ea3ca78 |
Close
Hashes for selectolax-0.2.5-pp27-pypy_73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fea286b8e92fc988606420f0aac537702315a689778af868aa1655218aaa45b |
|
MD5 | 84314005d9d71e759659675e5f0aadec |
|
BLAKE2b-256 | bf68a75d15943b4a9858badeafddb4ffddf1af9e4ba9bcc462b06501a7293473 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c60527543b7cc10081f2d04dcb4bc9c6458392262632c428cd48a1e4ef20ba |
|
MD5 | 182e4eab5d1b2a9961415edc6b0c7e04 |
|
BLAKE2b-256 | 718fec6cfe9d60f21f6d97177a2bc00df57de9f06815e72d7680c2d368d9e1db |
Close
Hashes for selectolax-0.2.5-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be865695c9c18566cab208eb2b907d3c80c1e47dfdc6d915fc32224c9126f3e1 |
|
MD5 | d127dec6fd3f4968fdd9442d280e88ab |
|
BLAKE2b-256 | 581ab317fbcc837252173eff290b613e3afaaa28e49d6e203005c8e9a5681d32 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f16025fa06c0fb0f3d5b65569d15843aca98b286d85c3bb6ff2b43e44a8c955 |
|
MD5 | b9dcb73b03863a2e939ad6ebf7b655aa |
|
BLAKE2b-256 | 4fc586c10c3b267ed660440583387caf5882f42ca1f8ac2bdce3cc69359c3015 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7411dee92880108b393c1fe904bde053704d5ef61079b7ebac785c0440537dda |
|
MD5 | 1a03cd00f50714c27908d1c9f7a41d93 |
|
BLAKE2b-256 | 5689f420dbb49865b8ae543373e6d65b56473faef102025cb64f36e49ee24b58 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec4b4f5478308e507642ffe7eb39eb98f974831ec96605aa635770609dab0d43 |
|
MD5 | 3e4f4f497aaf2e2cc0878264d073e048 |
|
BLAKE2b-256 | e2ed7dba7e3078f849067f6116d101e37536e6aa848e5bd05df670f51b5431d6 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a88313c68069c44e0d5093a05b96d9592569947a585e8f45bed45b0423eb58 |
|
MD5 | 48456761a8aee730ea93262114e17aff |
|
BLAKE2b-256 | fbdedc71277f075a2a407e68cf60571ee748277f1795812b5fed7c363522e590 |
Close
Hashes for selectolax-0.2.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979d9ad3b476afcc0e664119310a9c95f6d0a3b97b0dc301ad62bbefb82f2c16 |
|
MD5 | 2dd670ff173f9e8a3e4a8133efa2bd18 |
|
BLAKE2b-256 | 2a5680343e39c53212e3dcbe2e6affdafec85721f308d7ebde1ff91ce18581b7 |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52042542cf877abac309cf460d1fa258365b1fc16a84fe9b4d7184cd74576ddd |
|
MD5 | 8a5820ac06e41a3907e80e80ee549ac3 |
|
BLAKE2b-256 | 7c2ced984639a08bc05b8c9b8324e4d927f785b5efad5cb830e98d7399bf3415 |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f560cec0daf8f4db32398b29850a42a45c8ff8e4dbeea8c27e849618988f12 |
|
MD5 | cf2ae5a71339f00578ba33b6923ba49b |
|
BLAKE2b-256 | 1cc07ff44c4b5080a14dfbbd86393b9d1c9c911cbe5ea93a2bc969829c007587 |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3812f4614821bbeda4e1f1894635318c12bd0fd0a5c5c0619206ca98791e288c |
|
MD5 | 3f0f329fa259dce51d7e57708bc12108 |
|
BLAKE2b-256 | 39250978a3d47401e2af1bbe125c74dc9d8ef65fac258de3fc79579cb070d28f |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523abab818f356eb15f2aef92e04651bf4df1b9e4e43679d63db3c85fa348518 |
|
MD5 | 614fb3628fec380acbfc026d1cfcf061 |
|
BLAKE2b-256 | 1e972bee230800f078e7a94b076a5f7fd184a99bf7f2e4303c3024c0b6ea888f |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50e9f1b98aab59e0fb9d1da39968c065af348c22c74e6ffbd166a1eab2d0889c |
|
MD5 | 18bdb4bf0d41d1052970115fee293b51 |
|
BLAKE2b-256 | 4320d9ee70e44eac3075975b8bb291c9cbbac2bb6bb81657058da6043117a1b1 |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8969ec45b7190b7a64cff61e930a4d4f57c544e3e6f07a663498f7d3697c54f1 |
|
MD5 | 5b39b5c09388d5ffb638f081b1b0bf3e |
|
BLAKE2b-256 | ba864ac4e9d3e2367ef43aad218173ce50acfbef829826d199040bd91b856fe4 |
Close
Hashes for selectolax-0.2.5-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08156c4b099ef2430be836b891d17cd7d00ea3e81c8edf6db2b637077f6fc20f |
|
MD5 | 122dc86a66706bd6850668dc283d4f8e |
|
BLAKE2b-256 | 37f6740cecf2dfde941e7dc5f66da64ade65554d9295784b729f3ef7f744dd7d |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 847521111fd1ec6b753516f0b669418d4e54e3c419cb1218996dd26c0c925740 |
|
MD5 | f2a63e65b2acbd8f17e5d7c11f62276c |
|
BLAKE2b-256 | 47eec87b96971e0378de93f6e8fcfd11a5e66b6279a1096aaf96b09e07967e49 |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf610d3a0eb519bc4e4b8ece0d65fd82978d435a856245d74b32db635645406 |
|
MD5 | 87a2840333753d1503d34a5589688048 |
|
BLAKE2b-256 | 0c69e8302db21aabf2f7f32f8e435dddf728dff33d7c9d78f530b0bbb9538a77 |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d16a513201f98734e6c3daa039dd7ba261f493ff902c69c54450505839b6dcd |
|
MD5 | 35f4b5426cbda78fd25a9e3644bdb34e |
|
BLAKE2b-256 | 08c8f814fc7da24ff5f70c4ff17970f9a91a9498ac7122b01cbe516e9139141d |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf92296f124f77bbcac22f3190a80d10d216b6d687237a2995471d27e8d4fb6 |
|
MD5 | df419a0ecf2cd60bc4d85e84ec84670a |
|
BLAKE2b-256 | bfdf0971049e992fb6bb6ba66a70452c3e31b85fc2da1ca412468298a90c631a |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e19d53e20cd543bcd84215e7752ae64019c27a9aba1b7ed793a4862418eac44f |
|
MD5 | 276c13e059602a0b4cb60fde8ebae808 |
|
BLAKE2b-256 | 4de555e1291457a541c72ce59e128cb6ec9543369c23c226258c7471c395fd37 |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf40e1316437ee1595d839beadd2ad0c02770f659f6559671547359f272aa32 |
|
MD5 | c0c53218f3bca76f89f8d73e75370125 |
|
BLAKE2b-256 | b886160898471031fc274adc3c8b6a2ddf74281cc7bd502b22614e7c85adffd7 |
Close
Hashes for selectolax-0.2.5-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81d651cbae9c73aa9cabf3cb8aebd297af7a2687a42ffc0f3943f990cf320732 |
|
MD5 | b773332df8462782e50b43123a7506ce |
|
BLAKE2b-256 | effaa166e29fc6fa2c2fabfef2cf31fd942de290b7b46b5697856731587d12b9 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65f2ceb148fa1b9faf4824404d64f7033340242176b587d423cddbb73743441d |
|
MD5 | 8ec1fe2b0f39c565ab15cc8d15975da3 |
|
BLAKE2b-256 | d5a260a3cca0592e1d87bcebdcf97acc7ac2665e8b3371836c621ffbfd3d2949 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 240e07ee95830b7eaedae1e7515c76b37dc031f164e29cb0e94c4563d2fe22ce |
|
MD5 | 48e9006e7886f8a878952a9de248f171 |
|
BLAKE2b-256 | 82aaa7dd1700e36cac937812d102d7f1aa5fbb91e765af1214023a6606f6c297 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ec7c297882ca75e493e61f2a9ce7f908f787ca65d6bc0212da8d5e2abc2f487 |
|
MD5 | ce43e47d9d244feb4f19472539ee3552 |
|
BLAKE2b-256 | 5d2b36256a9a35053bc8c0956f9efda00eb69da5273d39b2c3db39688fb34221 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e22c8782012d151270ca9abf705a907f84a008a50bf9e171705944a758a4afc |
|
MD5 | f458def823fe8acef2f63c7d21d0b81a |
|
BLAKE2b-256 | 968274414e510ee1b7fcfbbeb30a5b2a2db1cfcb0f4278a4f982d53eefb95b23 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ce176d9ee1229f240f761ee883f40da0334e5105b33bda225ae7a4f5f876cb |
|
MD5 | 246755ee8d809e7642598b805555f204 |
|
BLAKE2b-256 | acaf1ff6a1f22602cf899f468103902879f9130a6fcfdfa8e6ab8584f6326599 |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94bf865895e2c10d1a07eb7377d2b8669aec97a8b9eafc1bda70b04f508f5983 |
|
MD5 | 579f48bd1932d0ae1d58dc73d016a191 |
|
BLAKE2b-256 | 7b3e3be10817193275fed53c4bbc033208edc5499ca0c00808796ce760537bba |
Close
Hashes for selectolax-0.2.5-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7274c2181036866ec31a812c883c1334e7f00933b2f58e2500f98f6f5d7ce0b |
|
MD5 | ee043a560c91fafe3fc40d34818652f7 |
|
BLAKE2b-256 | 6e4cf36122a490419142a340a16c5f7e93fda53f5db4fdf46850f7fdc4dc8e6c |