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
4738ae2d
Commit
4738ae2d
authored
Apr 25, 2014
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change url find to match #94
parent
f973889c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
PatternProcessorExample.java
...s/codecraft/webmagic/example/PatternProcessorExample.java
+3
-3
PatternRequestMatcher.java
.../us/codecraft/webmagic/handler/PatternRequestMatcher.java
+1
-1
No files found.
webmagic-extension/src/main/java/us/codecraft/webmagic/example/PatternProcessorExample.java
View file @
4738ae2d
...
...
@@ -31,7 +31,7 @@ public class PatternProcessorExample {
@Override
public
RequestMatcher
.
MatchOther
processResult
(
ResultItems
resultItems
,
Task
task
)
{
log
.
info
(
"Extracting from repo"
+
resultItems
.
getRequest
());
System
.
out
.
println
(
resultItems
.
get
(
"reponame"
));
System
.
out
.
println
(
"Repo name: "
+
resultItems
.
get
(
"reponame"
));
return
RequestMatcher
.
MatchOther
.
YES
;
}
};
...
...
@@ -49,12 +49,12 @@ public class PatternProcessorExample {
@Override
public
RequestMatcher
.
MatchOther
processResult
(
ResultItems
resultItems
,
Task
task
)
{
System
.
out
.
println
(
resultItems
.
get
(
"username"
));
System
.
out
.
println
(
"User name: "
+
resultItems
.
get
(
"username"
));
return
RequestMatcher
.
MatchOther
.
YES
;
}
};
CompositePageProcessor
pageProcessor
=
new
CompositePageProcessor
(
Site
.
me
().
setDomain
(
"github.com"
));
CompositePageProcessor
pageProcessor
=
new
CompositePageProcessor
(
Site
.
me
().
setDomain
(
"github.com"
)
.
setRetryTimes
(
0
).
setSleepTime
(
0
)
);
CompositePipeline
pipeline
=
new
CompositePipeline
();
pageProcessor
.
setSubPageProcessors
(
githubRepoProcessor
,
githubUserProcessor
);
...
...
webmagic-extension/src/main/java/us/codecraft/webmagic/handler/PatternRequestMatcher.java
View file @
4738ae2d
...
...
@@ -32,6 +32,6 @@ public abstract class PatternRequestMatcher implements RequestMatcher {
@Override
public
boolean
match
(
Request
request
)
{
return
patternCompiled
.
matcher
(
request
.
getUrl
()).
find
();
return
patternCompiled
.
matcher
(
request
.
getUrl
()).
matches
();
}
}
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