无法通过页面查询从 URL 获取 html

Not able to get html from URL with page query

我正在尝试从 URL 中获取特定的 html 文档,其中包含页码查询(“https://hudebnibazar.cz/kytary/110000/?p=181”)。但是,当我打印出结果 html 时,它总是给我第一页。

这是片段:

Document doc = Jsoup.connect("https://hudebnibazar.cz/kytary/110000/?p=181").get();
Element e = doc.body();

请试试这个:

Document doc = Jsoup.connect("https://hudebnibazar.cz/kytary/110000/").data​("p", "181").get();
Element e = doc.body();

因为我看到here in the documentation有一个方法data用来设置请求参数

原来是网站有 problem/strange 行为,已经解决了向端点发出两个请求并将第一个的会话 cookie 添加到第二个中的问题