Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用代理过程中报错 #55

Open
liuyu-struggle opened this issue Jan 7, 2020 · 0 comments
Open

使用代理过程中报错 #55

liuyu-struggle opened this issue Jan 7, 2020 · 0 comments

Comments

@liuyu-struggle
Copy link

liuyu-struggle commented Jan 7, 2020

使用代理过程中出现了与问题37出现的问题一样 #37

java.lang.ClassCastException: org.apache.http.message.BasicHttpRequest cannot be cast to org.apache.http.client.methods.HttpUriRequest
at cn.wanghaomiao.seimi.http.hc.HcDownloader.getRealUrl(HcDownloader.java:180) ~[SeimiCrawler-2.0.jar:na]
at cn.wanghaomiao.seimi.http.hc.HcDownloader.renderResponse(HcDownloader.java:117) ~[SeimiCrawler-2.0.jar:na]
at cn.wanghaomiao.seimi.http.hc.HcDownloader.process(HcDownloader.java:79) ~[SeimiCrawler-2.0.jar:na]
at cn.wanghaomiao.seimi.core.SeimiProcessor.run(SeimiProcessor.java:101) ~[SeimiCrawler-2.0.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_181]

但是在37问题中看到说使用okHttp就可以了,不使用默认的HttpClient,我在文档中也找到了使用OkHttp的办法,官方文档关于使用Okhttp链接。

更换为 okHttp之后上述问题的确没有了,但是出现了另一个问题,就是使用代理访问的返回结果response里面的content内容出现乱码,暂时不知如何解决。求大神解答!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant