0
A
回答
0
我曾经面临同样的问题。不幸的是,JSoup不是一个好的选择。我结束了使用apache http client,它与代理很好地工作。
这里是我的HTTP客户端配置的代理相关部分:
String ipStr = "the.proxy.ip.string";
int port = 8080;
String proxyLogin = "your login name";
String proxyPassword = "your password";
httpClient.getCredentialsProvider().setCredentials(
new AuthScope(ipStr, port),
new UsernamePasswordCredentials(proxyLogin, proxyPassword));
HttpHost httpHost = new HttpHost(ipStr, port, "http");
httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpHost);
可以使用HTTP客户端来获取网站或净JSON响应。如果内容是HTML,则可以使用JSoup作为解析器和返回的输入。如果你得到了JSON,那么你可能想使用一个像json-simple这样的JSON解析器(但是还有很多其他非常有用的JSON库!)
相关问题
- 1. JSON返回[对象对象]
- 2. 返回JSON对象
- 3. 返回JSON对象
- 4. 处理AJAX返回的对象JSON
- 5. 使用复杂对象从REST Web服务返回JSON对象
- 6. Java返回对象
- 7. 从Java调用Python代码并返回JSON对象
- 8. 返回的IQueryable从EF代理对象
- 9. 为什么hibernate返回代理对象?
- 10. 从dojo.xhrget返回json对象
- 11. 返回protobuf对象为json
- 12. 返回JSON对象问题
- 13. JsonView返回空JSON对象
- 14. JSON对象返回为undefined
- 15. php JSON对象返回null
- 16. JSON对象返回undefined?
- 17. JSON.parse返回[对象]从JSON
- 18. NullPointerException当返回json对象
- 19. json TimeSpan返回对象
- 20. 返回JSON对象nightwatch.js
- 21. lastfm JSON对象返回“undefined”
- 22. JSON对象返回-1
- 23. JSON解析返回{对象,对象}
- 24. Flash ActionScript 2 JSON返回[对象对象]
- 25. JSON返回[对象对象] angularjs
- 26. JSON对象返回null(android + json + php + mysql)
- 27. json编码返回非json对象
- 28. JSON:阅读大JSON对象返回undefined
- 29. ajax回调JSON对象返回undefined
- 30. 通过迭代json对象返回(回声)由php