Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remplacer BeautifulSoup par quelque chose de plus performant #1009

Open
fabienheureux opened this issue Nov 7, 2024 · 0 comments
Open

Remplacer BeautifulSoup par quelque chose de plus performant #1009

fabienheureux opened this issue Nov 7, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@fabienheureux
Copy link
Member

fabienheureux commented Nov 7, 2024

Cf https://github.com/incubateur-ademe/quefairedemesobjets/pull/968/files#r1832102064

J'ai arrêté d'utiliser BeautifulSoup qui est d'une lenteur abominable. J'utilise https://github.com/rushter/selectolax et je perso vois des 10x to 20x en rapidité sur mes projets, voir benchmark.

Exemple d'initialisation:

from selectolax.lexbor import LexborHTMLParser

tree = LexborHTMLParser(html)
elements = tree.css(".my-thing")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants