Description
jsoup is an open-source Java library for working with real-world HTML and XML. It fetches a URL, reads a file or a string, and parses it into a document you can search and change, using DOM methods, CSS selectors and XPath. The project says it implements the WHATWG HTML5 specification and parses HTML into the same DOM tree that modern browsers build, so pages with broken or unusual markup still produce a sensible tree. Typical uses include scraping and parsing a web page, finding and extracting data with selectors, changing elements, attributes and text, cleaning user-submitted HTML against a safelist to prevent cross-site scripting, and producing tidy HTML output. The site includes an example that fetches a page and parses it, a cookbook with introductory recipes for input, extracting data, modifying data, cleaning HTML and working with the web, and an API reference. jsoup can be used on Android, and the site lists its development status, author and a citation note. The source is on GitHub under jhy, and the release notes are in the repository's changes file. The site also has a news page, a bugs page and a discussion forum.…
Highlights
- Parse HTML from URL, file or string
- CSS selectors and DOM methods
- WHATWG HTML5 parsing
- Safelist-based HTML cleaning
- Tidy HTML output
- Android support
Ratings & Reviews
No ratings yet
Be the first to rate Jsoup.
People also visit
Lol Html
Low output latency streaming HTML parser/rewriter with CSS selector-based API
Jsoup FAQ
What is jsoup?
An open-source Java library for parsing, extracting, changing and cleaning HTML and XML.
How does it parse messy HTML?
The site says it follows the WHATWG HTML5 specification and builds the same DOM as modern browsers, so invalid markup still gets a sensible tree.
Can it clean user input?
Yes. It cleans HTML against a safelist to help prevent cross-site scripting.
Can I use it on Android?
Yes. The site has an Android support section.
How do I find data in a page?
With DOM traversal or CSS selectors, and the site gives XPath support.
Where is the source and documentation?
On GitHub under jhy, with a cookbook and API reference on jsoup.org.
What are the best Jsoup alternatives?
Popular alternatives to Jsoup include PhantomJsCloud and FromJS. See all Jsoup alternatives






