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)
Downloaderdownload in interface Downloaderrequest - requesttask - taskpublic void setThread(int thread)
DownloadersetThread in interface Downloaderthread - number of threadspublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2017. All rights reserved.