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
296a6892
Commit
296a6892
authored
Nov 14, 2013
by
yihua.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix javadoc and add setPipelines() for spider
parent
948fa094
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
Spider.java
...agic-core/src/main/java/us/codecraft/webmagic/Spider.java
+15
-1
ScriptConsole.java
...ain/java/us/codecraft/webmagic/scripts/ScriptConsole.java
+1
-0
oschina.js
webmagic-scripts/src/main/resources/js/oschina.js
+2
-0
pom.xml
webmagic-selenium/pom.xml
+1
-1
No files found.
webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java
View file @
296a6892
...
@@ -189,7 +189,7 @@ public class Spider implements Runnable, Task {
...
@@ -189,7 +189,7 @@ public class Spider implements Runnable, Task {
*
*
* @param pipeline
* @param pipeline
* @return this
* @return this
* @see #
set
Pipeline(us.codecraft.webmagic.pipeline.Pipeline)
* @see #
add
Pipeline(us.codecraft.webmagic.pipeline.Pipeline)
* @deprecated
* @deprecated
*/
*/
public
Spider
pipeline
(
Pipeline
pipeline
)
{
public
Spider
pipeline
(
Pipeline
pipeline
)
{
...
@@ -210,6 +210,20 @@ public class Spider implements Runnable, Task {
...
@@ -210,6 +210,20 @@ public class Spider implements Runnable, Task {
return
this
;
return
this
;
}
}
/**
* set pipelines for Spider
*
* @param pipeline
* @return this
* @see Pipeline
* @since 0.4.1
*/
public
Spider
setPipelines
(
List
<
Pipeline
>
pipelines
)
{
checkIfRunning
();
this
.
pipelines
=
pipelines
;
return
this
;
}
/**
/**
* clear the pipelines set
* clear the pipelines set
*
*
...
...
webmagic-scripts/src/main/java/us/codecraft/webmagic/scripts/ScriptConsole.java
View file @
296a6892
...
@@ -118,6 +118,7 @@ public class ScriptConsole {
...
@@ -118,6 +118,7 @@ public class ScriptConsole {
options
.
addOption
(
new
Option
(
"l"
,
"language"
,
true
,
"language"
));
options
.
addOption
(
new
Option
(
"l"
,
"language"
,
true
,
"language"
));
options
.
addOption
(
new
Option
(
"t"
,
"thread"
,
true
,
"thread"
));
options
.
addOption
(
new
Option
(
"t"
,
"thread"
,
true
,
"thread"
));
options
.
addOption
(
new
Option
(
"f"
,
"file"
,
true
,
"script file"
));
options
.
addOption
(
new
Option
(
"f"
,
"file"
,
true
,
"script file"
));
options
.
addOption
(
new
Option
(
"i"
,
"input"
,
true
,
"input file"
));
options
.
addOption
(
new
Option
(
"s"
,
"sleep"
,
true
,
"sleep time"
));
options
.
addOption
(
new
Option
(
"s"
,
"sleep"
,
true
,
"sleep time"
));
options
.
addOption
(
new
Option
(
"g"
,
"logger"
,
true
,
"sleep time"
));
options
.
addOption
(
new
Option
(
"g"
,
"logger"
,
true
,
"sleep time"
));
CommandLineParser
commandLineParser
=
new
PosixParser
();
CommandLineParser
commandLineParser
=
new
PosixParser
();
...
...
webmagic-scripts/src/main/resources/js/oschina.js
View file @
296a6892
...
@@ -6,4 +6,6 @@ var config = {
...
@@ -6,4 +6,6 @@ var config = {
ua
:
''
,
ua
:
''
,
sleepTime
:
20
sleepTime
:
20
}
}
title
=
$
(
"div.BlogTitle h1"
),
content
=
$
(
"div.BlogContent"
)
urls
(
"http://my
\\
.oschina
\\
.net/flashsword/blog/
\\
d+"
)
urls
(
"http://my
\\
.oschina
\\
.net/flashsword/blog/
\\
d+"
)
\ No newline at end of file
webmagic-selenium/pom.xml
View file @
296a6892
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
webmagic-parent
</artifactId>
<artifactId>
webmagic-parent
</artifactId>
<groupId>
us.codecraft
</groupId>
<groupId>
us.codecraft
</groupId>
<version>
0.4.
0
-SNAPSHOT
</version>
<version>
0.4.
1
-SNAPSHOT
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
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