本文整理汇总了Java中us.codecraft.webmagic.downloader.HttpClientDownloader类的典型用法代码示例。如果您正苦于以下问题:Java HttpClientDownloader类的具体用法?Java HttpClientDownloader怎么用?Java HttpClientDownloader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpClientDownloader类属于us.codecraft.webmagic.downloader包,在下文中一共展示了HttpClientDownloader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initComponent
import us.codecraft.webmagic.downloader.HttpClientDownloader; //导入依赖的package包/类
protected void initComponent() {
if (downloader == null) {
this.downloader = new HttpClientDownloader();
}
if (pipelines.isEmpty()) {
pipelines.add(new ConsolePipeline());
}
downloader.setThread(threadNum);
if (threadPool == null || threadPool.isShutdown()) {
if (executorService != null && !executorService.isShutdown()) {
threadPool = new CountableThreadPool(threadNum, executorService);
} else {
threadPool = new CountableThreadPool(threadNum);
}
}
if (startRequests != null) {
for (Request request : startRequests) {
addRequest(request);
}
startRequests.clear();
}
startTime = new Date();
}
开发者ID:hexiaohong-code,项目名称:LoginCrawler,代码行数:24,代码来源:SpiderLogin.java
示例2: checkComponent
import us.codecraft.webmagic.downloader.HttpClientDownloader; //导入依赖的package包/类
protected void checkComponent() {
if (downloader == null) {
this.downloader = new HttpClientDownloader();
}
if (pipelines.isEmpty()) {
pipelines.add(new ConsolePipeline());
}
downloader.setThread(threadNum);
}
开发者ID:yuany,项目名称:en-webmagic,代码行数:10,代码来源:Spider.java
示例3: SimpleHttpClient
import us.codecraft.webmagic.downloader.HttpClientDownloader; //导入依赖的package包/类
public SimpleHttpClient(Site site) {
this.site = site;
this.httpClientDownloader = new HttpClientDownloader();
}
开发者ID:code4craft,项目名称:webmagic,代码行数:5,代码来源:SimpleHttpClient.java
示例4: main
import us.codecraft.webmagic.downloader.HttpClientDownloader; //导入依赖的package包/类
public static void main(String[] args) {
HttpClientDownloader downloader = new HttpClientDownloader();
// Html html = downloader.download("http://v.163.com/special/Khan/multiples.html","utf-8");
Html html = downloader.download("http://v.163.com/special/Khan/multiples.html");
System.out.println(html);
}
开发者ID:caorong,项目名称:MediaCrawler,代码行数:7,代码来源:MagicRequest.java
注:本文中的us.codecraft.webmagic.downloader.HttpClientDownloader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论