Replace BeautifulSoup with Scrapling's parser
I maintainer di solito rispondono entro 6 giorni
@PastelStorm ci sta già lavorando.
Dal 24/3/2026.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Non viene indicato alcun file sorgente, punto di ingresso o test. Inizia individuando tutti gli utilizzi di BeautifulSoup nel repository, quindi esamina la guida alla migrazione di Scrapling e valuta la compatibilità con il comportamento esistente di analisi dei documenti; il lavoro è completo quando la sostituzione è integrata senza regressioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, I like your project, and I use it, but I see you are still using BeautifulSoup. Well, actually, there's a better, faster new parser now: Scrapling.
Scrapling is up to 1735 times faster than BS4 with html5lib and up to 698 times faster than BS4 with Lxml, as benchmarks show below, while using significantly less memory. While analyzing memory usage with memray for another library I use, I noticed that BeautifulSoup consumes more than 7 MB during import alone.
While Scrapling uses 1.5 MB in the same task, plus importing. Scrapling's parser is built on lxml
However, Scrapling doesn't provide only ways to select elements using CSS/XPATH selectors; it also offers new options, such as selecting elements by their text content using lateral search or regular expressions, and a find function similar to BS's, but more powerful and much faster.
Also, Scrapling automatically handles invalid/incomplete HTML through lxml.
Here's an article that shows every function in BeautifulSoup with its equivalent in Scrapling to make the migration easy: https://scrapling.readthedocs.io/en/latest/tutorials/migrating_from_beautifulsoup/
Also, if that interests you, it provides a way to make self-healing spiders that adapt to website design changes without AI, and it gives a method for finding elements similar to those found, as the AutoScraper library does. Still, it's way faster and better at this.
Here are two benchmarks from the documentation that compare it to all Python libraries in the market:
Text Extraction Speed Test (5000 nested elements)
| # | Library | Time (ms) | vs Scrapling |
|---|---|---|---|
| 1 | Scrapling | 1.92 | 1.0x |
| 2 | Parsel/Scrapy | 1.99 | 1.036x |
| 3 | Raw Lxml | 2.33 | 1.214x |
| 4 | PyQuery | 20.61 | ~11x |
| 5 | Selectolax | 80.65 | ~42x |
| 6 | BS4 with Lxml | 1283.21 | ~698x |
| 7 | MechanicalSoup | 1304.57 | ~679x |
| 8 | BS4 with html5lib | 3331.96 | ~1735x |
Element Similarity & Text Search Performance
| Library | Time (ms) | vs Scrapling |
|---|---|---|
| Scrapling | 1.87 | 1.0x |
| AutoScraper | 10.24 | 5.476x |
It would be a solid addition to unstructured, what do you think?
I'm the author of Scrapling, so you might think I'm biased towards my library, but that's not true —you can see for yourself.
If you need any changes to make this happen, please let me know.
- Lingua principale
- HTML
- Stelle
- 15.8k
- Fork
- 1.4k
- Merge medio
- 8g 4h
- PR unite (30g)
- 40
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Unstructured-IO/unstructured
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Unstructured-IO/unstructured#4876 ·
I maintainer di solito rispondono entro 6 giorni
-
bug: partition_email() raises io.UnsupportedOperation on a file-like object that cannot seekForse già presa @Bensonluo l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Unstructured-IO/unstructured#4864 ·
I maintainer di solito rispondono entro 6 giorni
-
fix(nlp): match single-letter bullets in the enumerated bullet patternForse già presa @Eapp1e l’ha presa 33 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Unstructured-IO/unstructured#4635 ·
I maintainer di solito rispondono entro 6 giorni
-
bug(cleaners): translate_text passes text instead of chunk in attention window loopForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
Unstructured-IO/unstructured#4558 · 1 commento ·
I maintainer di solito rispondono entro 6 giorni
-
extract_text_before/extract_text_after raise UnboundLocalError when the pattern is absentForse già presa @ayam04 l’ha presa 103 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Unstructured-IO/unstructured#4427 · 3 commenti ·
I maintainer di solito rispondono entro 6 giorni
Tutte le issue di Unstructured-IO/unstructured
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
fairagro/m4.2_sql_to_arc#388 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: FAP TV Gay FeedApertacheck:failed feeds:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
iptv-org/database#40182 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
copilot-metrics
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area: explore bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
nplhse/collaborative-ivena-statistics#2107 ·
I maintainer di solito rispondono entro 1 giorno