开发者

I am using org.htmlparser.Parser to parse URL but its failing for external URLS and giving Connection Refused: connect error

I am using org.htmlparser.Parser to parse URL, it works fine for all internal URLs that are in network. But when i try opening external URLs, it gives

Exception in thread "main" org.htmlparser.util.ParserException: Connection refused: connect; java.net.ConnectException: Connection refused: connect

This line is failing -

Parser p = new Parser("http://www.google.com");

I can open external URLs in browser using proxy. So i am doing the proxy authentication using Authenticator class in the co开发者_如何学Pythonde as well but its not working.


You might want to set the proxy connectivity parameters when you run the java program

java -Dhttp.proxyHost=proxyhostURL
     -Dhttp.proxyPort=proxyPortNumber
     -Dhttp.proxyUser=someUserName
     -Dhttp.proxyPassword=somePassword javaClassToRun
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜