- Notifications
You must be signed in to change notification settings - Fork18
fcannizzaro/jsoup-annotations
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Jsoup Annotations POJO
Add the JitPack repository to your build file
allprojects { repositories {... maven { url'https://jitpack.io' } } }
Add the dependency
dependencies { compile'com.github.fcannizzaro:jsoup-annotations:1.0.3' }
Elementhtml =Jsoup.connect("https://www.npmjs.com/").get();/** Scrape!* Use JsoupProcessor or JP*/NPMnpm =JP.from(html,NPM.class);// orList<Package>packages =JP.fromList(html,Package.class);
SeeSample Code
Can be used for class or field.
@Selector("#content")classContent {// internal elements}
@Text("h3")Stringtitle;
@Html("div.inner")Stringhtml;
@Attr(query="a",attr="href")Stringhref;
@Text("head > title")voidtitle(Stringtitle){// do something with result}
@ForEach("li")voiditerate(Elementelement,intindex){// [required] element// [optional] index// do something}
@AfterBindvoidattached(){// called after object binding is completed.}
DenoteField as child element (POJO).
DenoteField as List of Elements (POJO).
Francesco Cannizzaro (fcannizzaro)
Copyright 2017 Francesco Saverio CannizzaroLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.About
Jsoup Annotations POJO
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published