public interface Downloader
setThread(int) method because downloader is always the bottleneck of a crawler,
there are always some mechanisms such as pooling in downloader, and pool size is related to thread numbers.| Modifier and Type | Method and Description |
|---|---|
Page |
download(Request request,
Task task)
Downloads web pages and store in Page object.
|
void |
setThread(int threadNum)
Tell the downloader how many threads the spider used.
|
Page download(Request request, Task task)
request - requesttask - taskvoid setThread(int threadNum)
threadNum - number of threadsCopyright © 2017. All rights reserved.