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
7b45bc9a
Commit
7b45bc9a
authored
Apr 23, 2018
by
shenjunlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加超时操作
parent
10d3b829
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
9 deletions
+10
-9
pom.xml
pom.xml
+1
-1
pom.xml
webmagic-core/pom.xml
+1
-1
pom.xml
webmagic-extension/pom.xml
+1
-1
SeleniumDownloader.java
.../us/codecraft/webmagic/downloader/SeleniumDownloader.java
+4
-3
pom.xml
webmagic-samples/pom.xml
+1
-1
pom.xml
webmagic-saxon/pom.xml
+1
-1
pom.xml
webmagic-scripts/pom.xml
+1
-1
No files found.
pom.xml
View file @
7b45bc9a
...
...
@@ -6,7 +6,7 @@
<version>
7
</version>
</parent>
<groupId>
us.codecraft.duiba
</groupId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
pom
</packaging>
<properties>
...
...
webmagic-core/pom.xml
View file @
7b45bc9a
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft.duiba
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-extension/pom.xml
View file @
7b45bc9a
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft.duiba
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-extension/src/main/java/us/codecraft/webmagic/downloader/SeleniumDownloader.java
View file @
7b45bc9a
package
us
.
codecraft
.
webmagic
.
downloader
;
import
com.sun.tools.internal.xjc.reader.xmlschema.BindYellow
;
import
io.github.bonigarcia.wdm.ChromeDriverManager
;
import
io.github.bonigarcia.wdm.InternetExplorerDriverManager
;
import
io.github.bonigarcia.wdm.PhantomJsDriverManager
;
...
...
@@ -141,9 +140,11 @@ public class SeleniumDownloader implements Downloader, Closeable {
logger
.
info
(
"downloading page "
+
request
.
getUrl
());
String
content
=
""
;
try
{
webDriver
.
manage
().
timeouts
().
pageLoadTimeout
(
8
,
TimeUnit
.
SECONDS
);
webDriver
.
get
(
request
.
getUrl
());
new
WebDriverWait
(
webDriver
,
10
)
.
until
(
ExpectedConditions
.
presenceOfElementLocated
(
By
.
xpath
(
"/html"
)));
WebDriverWait
webDriverWait
=
new
WebDriverWait
(
webDriver
,
8
);
webDriverWait
.
until
(
ExpectedConditions
.
presenceOfElementLocated
(
By
.
xpath
(
"/html"
)));
WebElement
webElement
=
webDriver
.
findElement
(
By
.
xpath
(
"/html"
));
content
=
webElement
.
getAttribute
(
"outerHTML"
);
// Thread.sleep(sleepTime);
...
...
webmagic-samples/pom.xml
View file @
7b45bc9a
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft.duiba
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-saxon/pom.xml
View file @
7b45bc9a
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft.duiba
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
...
...
webmagic-scripts/pom.xml
View file @
7b45bc9a
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
us.codecraft.duiba
</groupId>
<artifactId>
webmagic-parent
</artifactId>
<version>
0.8.
4
-SNAPSHOT
</version>
<version>
0.8.
6
-SNAPSHOT
</version>
</parent>
<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