Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webmagic
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
webmagic
Commits
16ae066c
Commit
16ae066c
authored
Mar 03, 2014
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sample code in readme #63
parent
4d628d80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
README.md
README.md
+5
-6
No files found.
README.md
View file @
16ae066c
...
@@ -41,8 +41,7 @@ Write a class implements PageProcessor:
...
@@ -41,8 +41,7 @@ Write a class implements PageProcessor:
```
java
```
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"
);
.
addStartUrl
(
"http://my.oschina.net/flashsword/blog"
);
@Override
@Override
public
void
process
(
Page
page
)
{
public
void
process
(
Page
page
)
{
...
@@ -60,8 +59,8 @@ Write a class implements PageProcessor:
...
@@ -60,8 +59,8 @@ Write a class implements PageProcessor:
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
Spider
.
create
(
new
OschinaBlogPageProcesser
())
Spider
.
create
(
new
OschinaBlogPageProcesser
())
.
addUrl
(
"http://my.oschina.net/flashsword/blog"
)
.
p
ipeline
(
new
ConsolePipeline
()).
run
();
.
addP
ipeline
(
new
ConsolePipeline
()).
run
();
}
}
}
}
```
```
...
@@ -87,8 +86,8 @@ You can also use annotation way:
...
@@ -87,8 +86,8 @@ You can also use annotation way:
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
OOSpider
.
create
(
OOSpider
.
create
(
Site
.
me
()
.
addStartUrl
(
"http://my.oschina.net/flashsword/blog"
)
,
Site
.
me
(),
new
ConsolePageModelPipeline
(),
OschinaBlog
.
class
).
run
();
new
ConsolePageModelPipeline
(),
OschinaBlog
.
class
).
addUrl
(
"http://my.oschina.net/flashsword/blog"
).
run
();
}
}
}
}
```
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment