サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
衆院選
jsoup.org
Introduction Parsing and traversing a Document Input Parse a document from a String Parsing a body fragment Load a Document from a URL Load a Document from a File Extracting data Use DOM methods to navigate a document Use CSS selectors to find elements Use XPath selectors to find elements and nodes Extract attributes, text, and HTML from elements Working with relative and absolute URLs Example pro
CSS-like element selector, that finds elements matching a query. Selector syntax A selector is a chain of simple selectors, separated by combinators. Selectors are case insensitive (including against elements, attributes, and attribute values). The universal selector * is implicit when no element selector is supplied (i.e. .header and *.header are equivalent). Pattern Matches Example
jsoup: Java HTML parser that makes sense of real-world HTML soup. jsoup is a Java library for working with real-world HTML. It provides a very convenient API for fetching URLs and extracting and manipulating data, using the best of HTML5 DOM methods and CSS selectors. jsoup implements the WHATWG HTML specification, and parses HTML to the same DOM as modern browsers do. parse HTML from a URL, file,
Problem You want to find or manipulate elements using CSS selectors. Solution Use the Element.select(String cssSelector) and Elements.select(String selector) methods: File input = new File("/tmp/input.html"); Document doc = Jsoup.parse(input, "UTF-8", "https://example.com/"); Elements links = doc.select("a[href]"); // a with href Elements pngs = doc.select("img[src$=.png]"); // img with src ending
jsoup: Java HTML Parser jsoup is a Java library that simplifies working with real-world HTML and XML. It offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM API methods, CSS, and xpath selectors. jsoup implements the WHATWG HTML5 specification, and parses HTML to the same DOM as modern browsers. scrape and parse HTML from a URL, file, or string find and
このページを最初にブックマークしてみませんか?
『jsoup Java HTML Parser, with best of DOM, CSS, and jquery』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く