# scinfu/SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)

Repository: https://github.com/scinfu/SwiftSoup
Canonical: https://ross.abutalabs.com/products/swiftsoup
Homepage: https://scinfu.github.io/SwiftSoup/
Language: Swift
License: MIT
License Family: permissive
Topics: swift, swiftsoup, parse, html-document, dom, extract, selector, html
Last push: 2026-08-26T02:34:52+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 3575, "days_push": 8, "days_rel": 8, "gap_med": 7, "n_releases_24m": 34}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5119, forks 398 (observed 2026-08-28T04:09:10.889274+00:00)

## What it is
SwiftSoup is a pure Swift HTML parser library that conforms to the WHATWG HTML5 specification and offers DOM traversal, CSS selectors, and jQuery-like APIs. It supports parsing, scraping, modifying, and sanitizing HTML across macOS, iOS, tvOS, watchOS, and Linux.

## Use cases
- parse html from a string or file in swift
- scrape data from web pages using css selectors
- extract links and text from html documents
- sanitize user-submitted html to prevent xss
- clean up messy tag soup html into a valid parse tree
- modify html elements and attributes programmatically

## When to choose
- you need HTML parsing in a Swift project on Apple platforms or Linux
- you want a pure Swift solution with no C dependencies
- you need jQuery-style selectors and DOM manipulation
- you must sanitize untrusted HTML input

## When to avoid
- your project is not in Swift
- you need JavaScript execution or a full browser engine
- you only need XML parsing rather than HTML

## Facets
- artifact type: library
- maturity: stable
- function: parser, web-scraping, security
- domain: web-development, parsers, developer-tools
- platform: cross-platform
- tags: html-parsing, css-selectors, dom, jquery-like, xss-sanitization, whatwg-html5, swift-package-manager, macos, ios, linux, swift

## Member repositories
- scinfu/SwiftSoup (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:10.889274+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:02:06.300144+00:00, confidence not recorded.
  - readme: https://github.com/scinfu/SwiftSoup (fetched 2026-08-28T04:09:10.889274+00:00, sha 9fc0b47b71ed)
  - homepage: https://scinfu.github.io/SwiftSoup/ (fetched 2026-08-29T08:56:44.363607+00:00, sha 824a35e51694)
- Data as of 2026-08-30T08:39:29.467469+00:00.
