• Stars
    star
    239
  • Rank 168,763 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Jsoup Annotations POJO

jsoup-annotations

Jsoup Annotations POJO

Build Status Android Arsenal Codacy Badge

Gradle Dependency

Step 1.

Add the JitPack repository to your build file

  allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
  }

Step 2.

Add the dependency

  dependencies {
    compile 'com.github.fcannizzaro:jsoup-annotations:1.0.3'
  }

Usage

Element html = Jsoup.connect("https://www.npmjs.com/").get();

/*
*  Scrape!
*  Use JsoupProcessor or JP
*/

NPM npm = JP.from(html, NPM.class);

// or

List<Package> packages = JP.fromList(html, Package.class);

See Sample Code

Annotations

@Selector(String: query)

Can be used for class or field.

@Selector("#content")
class Content {
  
  // internal elements

}

@Text(String: query)

@Text("h3")
String title;

@Html(String: query)

@Html("div.inner")
String html;

@Attr(String: query, String: attr)

@Attr(query="a", attr="href")
String href;

Text, Html, Attr can be also attached to methods like:

@Text("head > title")
void title(String title){
  // do something with result
}

@ForEach(String: query)

@ForEach("li")
void iterate(Element element, int index){
  // [required] element
  // [optional] index 
  // do something
}

@AfterBind

@AfterBind
void attached(){
  // called after object binding is completed.
}

@Child

Denote Field as child element (POJO).

@Items

Denote Field as List of Elements (POJO).

Author

Francesco Cannizzaro (fcannizzaro)

License

Copyright 2017 Francesco Saverio Cannizzaro

Licensed 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.0

Unless required by applicable law or agreed to in writing, software
distributed 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 and
limitations under the License.

More Repositories

1

ksoup

Kotlin Wrapper for Jsoup
Kotlin
61
star
2

win-audio

Get, Set and Watch Speaker/Microphone Volume on Windows
C++
48
star
3

com.dim.streamdeck

A Stream Deck plugin to interact with Destiny Item Manager and Destiny 2
TypeScript
30
star
4

fast-event

Simple event creation
Java
14
star
5

kson

Kotlin Json DSL
Kotlin
9
star
6

react-use-cookie-watcher

react hook to watch browser cookies
TypeScript
7
star
7

genshin-deck

A Stream Deck plugin for Genshin Impact
TypeScript
7
star
8

npm-install

sublime package to auto install/uninstall npm modules, show current status, open npmjs documentation.
Python
4
star
9

nfa-to-dfa

Convert NFA to DFA (json output) from (json input, .nfa file)
JavaScript
4
star
10

remote-tile

Cyanogenmod Custom Tile (Server + Android)
Java
4
star
11

mkdocs-sequence-js-plugin

MkDocs plugin to render sequence.js blocks
Python
4
star
12

av-light

Avantek light bulb CLI
JavaScript
3
star
13

resourcer

Java Resources Annotations
Java
3
star
14

youtube-pip

Youtube Electron + Chrome Picture-in-Picture
JavaScript
3
star
15

spotify-control

View and Control your Spotify experience without leaving Sublime Text
Python
3
star
16

c-progress-bar

Simple Animated Progress Bar (Terminal | Windows)
C
2
star
17

esp8266-request

Make simple http requests on esp8266 Micropython
Python
2
star
18

git-card

AngularJS Github Card
JavaScript
2
star
19

av-light-api

Avantek Light Bulb API
JavaScript
2
star
20

sublime-file-downloader

download, browse and open file's urls
Python
1
star
21

unipa-api

Unipa Unofficial API
1
star
22

stream-deck-rust-sdk

Unofficial Elgato Stream Deck SDK for Rust
Rust
1
star
23

dot-js

Use dot notation to get/set value in object
JavaScript
1
star
24

material-icons

Java Material Design Icons from Google
Java
1
star
25

material-colors-bot

Material Colors Everywhere!
JavaScript
1
star
26

cerebro-thingiverse

Cerebro plugin to find things on thingiverse
JavaScript
1
star
27

react-use-redux-fast

hooks and notation to use redux store and actions
JavaScript
1
star
28

prefs

Simple Java Preferences (JSON based)
Java
1
star
29

com.destiny.solo.enabler

A Stream Deck plugin to enable/disable the solo mode for Destiny 2
TypeScript
1
star
30

firebase-messaging

NodeJS module to send firebase messages
JavaScript
1
star
31

destiny-transparent-weapons

Collection of legendary and exotic weapons images from Destiny 2
JavaScript
1
star