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

升级到0.1.4后,Ksoup.parseGetRequest(url)不可用了 #43

Closed
Matcha-xiaobin opened this issue Aug 7, 2024 · 5 comments
Closed
Assignees

Comments

@Matcha-xiaobin
Copy link

Describe the bug
ksoup 升级到0.1.4版本后,
ktor 今天也更新到了3.0.0-beta-2(为了支持wasmJs)
刚刚发现使用Ksoup.parseGetRequest(url)请求页面内容时,android 端会遇到400 Bad Request错误,桌面端也出现了部分页面异常
目前暂时先使用Ktor请求页面数据后,采用Ksoup.parse(result)的方式解决问题

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Sample Code
If applicable, add sample code or snippets to help explain your problem.

Device (please complete the following information):

  • Device: android
  • OS: android 14

Additional context
由于时间太晚了,我这里现在是凌晨 00:43分,所以没琢磨是怎么回事,但我有注意到似乎不是使用的ktor作为Ksoup的网络请求工具,也许新的这个存在某种问题。

@itboy87
Copy link
Collaborator

itboy87 commented Aug 8, 2024

@Matcha-xiaobin we can't reproduce this issue can you please give us link with which you have that issue?

@Matcha-xiaobin
Copy link
Author

Matcha-xiaobin commented Aug 8, 2024

@itboy87
测试访问页面地址: https://fengchedmp.com
测试代码:

val htmlElement = Ksoup.parseGetRequest("https://fengchedmp.com")
val elementText = htmlElement.text()
Log.d("页面数据: $elementText")

log:
页面数据: 400 Bad Request nginx

Desktop (win11) 端也是这样:
TAG: ҳ������: 400 Bad Request 400 Bad Request nginx
image

@itboy87
Copy link
Collaborator

itboy87 commented Aug 9, 2024

@Matcha-xiaobin its working fine if link end with slash https://fengchedmp.com/ may be host verifying something and i think its not issue related to ksoup

@itboy87
Copy link
Collaborator

itboy87 commented Aug 9, 2024

@Matcha-xiaobin i found this issue related to korlibs-network i already opened pull request for this korlibs/korlibs-io-network-core#4 and for now you need to append / at the end of link

@Matcha-xiaobin
Copy link
Author

@Matcha-xiaobin i found this issue related to korlibs-network i already opened pull request for this korlibs/korlibs-io-network-core#4 and for now you need to append / at the end of link

Okay, thanks!

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

2 participants