【问题标题】:How to solve ConnectException error when using Boilerpipe?使用 Boilerpipe 时如何解决 ConnectException 错误?
【发布时间】:2015-04-09 09:07:01
【问题描述】:

我想使用 Boilerpipe 从几个网站的新闻页面中提取文本,问题是每次尝试时,我都会收到 ConnectionException 错误。 我只是使用了boilerpipe quickstart guide 中的示例语法:

URL url = new URL("http://www.telegraph.co.uk/news/health/11523739/Nine-in-10-GPs-say-no-to-seven-day-opening.html");
String text = ArticleExtractor.INSTANCE.getText(url);

这是连接错误:

de.l3s.boilerpipe.BoilerpipeProcessingException: java.net.ConnectException: Connection refused: connect
   at de.l3s.boilerpipe.extractors.ExtractorBase.getText(ExtractorBase.java:89)
   at extract.Test.main(Test.java:14)
Caused by: java.net.ConnectException: Connection refused: connect

我尝试了很多网站,但都遇到了同样的错误。

我该如何解决这个问题,或者至少看看问题出在哪里? (可能是防火墙,或者端口配置……)

【问题讨论】:

    标签: java exception connection connectexception boilerpipe


    【解决方案1】:

    经过进一步研究,我发现是企业中的防火墙阻止了这些请求。

    【讨论】:

      猜你喜欢
      • 2021-09-04
      • 2019-11-02
      • 2020-02-22
      • 1970-01-01
      • 2022-01-17
      • 2017-03-24
      • 2018-04-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多