Replace BeautifulSoup with Scrapling's parser
Maintainers usually reply within 6 days
@PastelStorm is already working on this.
Since Mar 24, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
No source file, entry point, or test is named. Start by locating all BeautifulSoup usage in the repository, then review Scrapling's migration guide and assess compatibility with the existing document-parsing behavior; done means the replacement is integrated without regressions.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- HTML
- Stars
- 15.8k
- Forks
- 1.4k
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 40
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Unstructured-IO/unstructured
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Unstructured-IO/unstructured#4876 ·
Maintainers usually reply within 6 days
-
bug: partition_email() raises io.UnsupportedOperation on a file-like object that cannot seekPossibly taken @Bensonluo claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Unstructured-IO/unstructured#4864 ·
Maintainers usually reply within 6 days
-
fix(nlp): match single-letter bullets in the enumerated bullet patternPossibly taken @Eapp1e claimed this 33 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Unstructured-IO/unstructured#4635 ·
Maintainers usually reply within 6 days
-
bug(cleaners): translate_text passes text instead of chunk in attention window loopPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Unstructured-IO/unstructured#4558 · 1 comment ·
Maintainers usually reply within 6 days
-
extract_text_before/extract_text_after raise UnboundLocalError when the pattern is absentPossibly taken @ayam04 claimed this 103 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Unstructured-IO/unstructured#4427 · 3 comments ·
Maintainers usually reply within 6 days
All issues in Unstructured-IO/unstructured
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
fairagro/m4.2_sql_to_arc#388 ·
Maintainers usually reply within 1 day
-
Add: FAP TV Gay FeedOpencheck:failed feeds:add
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
iptv-org/database#40182 · 1 comment ·
Maintainers usually reply within 1 day
-
copilot-metrics
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area: explore bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nplhse/collaborative-ivena-statistics#2107 ·
Maintainers usually reply within 1 day