【问题标题】:What is the alternative for ApacheHttpClient class in selenium [duplicate]selenium 中 ApacheHttpClient 类的替代方法是什么[重复]
【发布时间】:2020-01-08 19:29:59
【问题描述】:

我的代码如下

RemoteWebDriver driver = new RemoteWebDriver(new HttpCommandExecutor(new HashMap<String, CommandInfo>(),
                new URL(URL), new Factory() {
                    private HttpClientBuilder builder;
                    {
                        builder = HttpClientBuilder.create();
                        HttpHost proxy = new HttpHost(proxy,proxyport);
                        System.out.println(proxy);
                        builder.setProxy(proxy);                        
                        System.out.println(builder);

                    }

                    @Override
                    public HttpClient createClient(URL url) {
                        return new ApacheHttpClient(builder.build(), url);
                    }                       

但由于 ApacheHttpClient 类已被弃用,在上述代码中使用 ApacheHttpClient 类的替代方案是什么

【问题讨论】:

标签: java selenium remotewebdriver


【解决方案1】:

您可以使用 HttpClient 代替 ApacheHttpClient

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-09
    • 2015-04-12
    • 1970-01-01
    • 1970-01-01
    • 2016-01-20
    • 1970-01-01
    • 2022-11-13
    • 2015-02-13
    相关资源
    最近更新 更多