{"repo":"rushter/selectolax","free":true,"listed":false,"github":"https://github.com/rushter/selectolax","clone":"git clone https://github.com/rushter/selectolax.git","description":"Python binding to Modest and Lexbor engines. Fast HTML5 parser with CSS selectors for Python.","language":"Cython","stars":1666,"topics":["python","html5","css","web-scraping","parser","html","crawler","scraper"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"--- A fast HTML5 parser with CSS selectors, written in Cython, using Modest and Lexbor engines. --- --- Installation From PyPI using pip: If installation fails due to compilation errors, you may need to install Cython: This usually happens when you try to install an outdated version of selectolax on a newer version of Python. Development version from GitHub: How to compile selectolax while developing: Basic examples Here are some basic examples to get you started with selectolax: Parsing HTML and extracting text: Using advanced CSS selectors Using lexbor-contains CSS pseudo-class to match text More examples Available backends Selectolax supports two backends: Modest and Lexbor . By default, all examples use the Lexbor backend. Most of the features between backends are almost identical, but there are some differences. As of 2024, the preferred backend is Lexbor . The Modest backend is still available for compatibility reasons and the underlying C library that selectolax uses is not maintained anymore. To use lexbor , just import the parser and use it in the similar way to the HTMLParser . Simple Benchmark Extract title, links, scripts and a meta tag from main pages of top 754 domains. See examples/benchmark.py for more information. Package Time ------------------------------- ----------- Beautiful Soup (html.parser) 61.02 sec. lxml / Beautiful Soup (lxml) 9.09 sec. html5 parser 16.10 sec. selectolax (Modest) 2.94 sec. selectolax (Lexbor) 2.39 sec. Links selectolax API referenc","default_branch":null,"files":null,"tree":[],"storefront":"/r/rushter","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rushter/selectolax/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}