Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 667 Bytes

README.md

File metadata and controls

17 lines (15 loc) · 667 Bytes

Parsel

Parsel is a Java library for parsing HTML and XML to extract data using XPath selector. The project is inspired by Python's Parsel library.

Example

import io.parsel.Selector;
import io.parsel.SelectorList;

public class Example {
    public static void main(String[] args) {
        String text = "<html><head><title>Selector List</title></head></html>";
        Selector selector = new Selector(text);
        SelectorList title = selector.xpath("//title/text()");
        // This will output "Selector List".
        System.out.println(title.extract()[0]);
    }
}