syntax hightlight
parent
d7abbd0e4b
commit
e87489d5dc
|
@ -36,6 +36,7 @@ Add dependencies to your pom.xml:
|
||||||
|
|
||||||
Write a class implements PageProcessor:
|
Write a class implements PageProcessor:
|
||||||
|
|
||||||
|
```java
|
||||||
public class OschinaBlogPageProcesser implements PageProcessor {
|
public class OschinaBlogPageProcesser implements PageProcessor {
|
||||||
|
|
||||||
private Site site = Site.me().setDomain("my.oschina.net")
|
private Site site = Site.me().setDomain("my.oschina.net")
|
||||||
|
@ -61,6 +62,7 @@ Write a class implements PageProcessor:
|
||||||
.pipeline(new ConsolePipeline()).run();
|
.pipeline(new ConsolePipeline()).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
* `page.addTargetRequests(links)`
|
* `page.addTargetRequests(links)`
|
||||||
|
|
||||||
|
@ -68,6 +70,7 @@ Write a class implements PageProcessor:
|
||||||
|
|
||||||
You can also use annotation way:
|
You can also use annotation way:
|
||||||
|
|
||||||
|
```java
|
||||||
@TargetUrl("http://my.oschina.net/flashsword/blog/\\d+")
|
@TargetUrl("http://my.oschina.net/flashsword/blog/\\d+")
|
||||||
public class OschinaBlog {
|
public class OschinaBlog {
|
||||||
|
|
||||||
|
@ -86,6 +89,7 @@ You can also use annotation way:
|
||||||
new ConsolePageModelPipeline(), OschinaBlog.class).run();
|
new ConsolePageModelPipeline(), OschinaBlog.class).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Docs and samples:
|
### Docs and samples:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue