Android jsoup,如何选择项目并转到下一页

发布于 2024-12-16 20:02:16 字数 453 浏览 1 评论 0原文

我想查询香港IFC商场店的iPhone4s库存情况。

所以,我需要去选择产品来检测库存状态“选择产品链接"。但在我进入选择产品页面之前,有必要在上一页中选择商店。如果我没有选择商店,直接进入选择产品页面,会显示“您的会话超时”。

如何以编程方式在 Apple 商店预订 并通过 jsoup 转到下一页?

I want to check Hong Kong IFC mall store's iPhone4s stock state.

So, I need to go Choose products to detect the stock state "choose product link". But before I go to the Choose product pages, it necessary to choose store in previous page. if I didn't choose the store, and direct go to choose product page, it will display "Your session timed out."

How do I programmatically choose IFC mall in Apple store reserve and go to next pages by jsoup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2024-12-23 20:02:16

它将显示“您的会话超时。”

该会话由 cookie 支持。您需要通过在后续请求中发送回检索到的响应 cookie 来维护会话。

// #1.
Connection connection1 = Jsoup.connect("http://example.com/firstpage");
Response response1 = connection1.execute();
Map<String, String> cookies = response1.cookies();
Document document1 = response1.parse(); // If necessary.
// ...

// #2.
Connection connection2 = Jsoup.connect("http://example.com/nextpage").cookies(cookies).data("param1", "value1");
Response response2 = connection2.execute();
cookies.putAll(response2.cookies());
Document document2 = response2.parse();
// ...

// Repeat #2.

it will display "Your session timed out."

The session is backed by cookies. You need to maintain the session by sending the retrieved response cookies back on subsequent requests.

// #1.
Connection connection1 = Jsoup.connect("http://example.com/firstpage");
Response response1 = connection1.execute();
Map<String, String> cookies = response1.cookies();
Document document1 = response1.parse(); // If necessary.
// ...

// #2.
Connection connection2 = Jsoup.connect("http://example.com/nextpage").cookies(cookies).data("param1", "value1");
Response response2 = connection2.execute();
cookies.putAll(response2.cookies());
Document document2 = response2.parse();
// ...

// Repeat #2.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文