public class SeleniumDownloader extends Object implements Downloader, Closeable
Constructor and Description |
---|
SeleniumDownloader()
Constructor without any filed.
|
SeleniumDownloader(String chromeDriverPath)
新建
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
Page |
download(Request request,
Task task)
Downloads web pages and store in Page object.
|
SeleniumDownloader |
setSleepTime(int sleepTime)
set sleep time to wait until load success
|
void |
setThread(int thread)
Tell the downloader how many threads the spider used.
|
public SeleniumDownloader(String chromeDriverPath)
chromeDriverPath
- chromeDriverPathpublic SeleniumDownloader()
public SeleniumDownloader setSleepTime(int sleepTime)
sleepTime
- sleepTimepublic Page download(Request request, Task task)
Downloader
download
in interface Downloader
request
- requesttask
- taskpublic void setThread(int thread)
Downloader
setThread
in interface Downloader
thread
- number of threadspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2017. All rights reserved.