gpt4 book ai didi

java - 如何在屏幕抓取时使用 cookie?

转载 作者:行者123 更新时间:2023-12-02 07:47:13 29 4
gpt4 key购买 nike

我想从登录页面后面的 PHP 网页中抓取数据。如何才能让我只登录一次,然后就可以访问后续页面的数据而无需再次登录?

最佳答案

我建议使用Android's HttpClient` library内置于操作系统中。默认情况下,他们会自动管理您的 cookie。引用他们的文档:

Interface for an HTTP client. HTTP clients encapsulate a smorgasbord of objects required to execute HTTP requests while handling cookies, authentication, connection management, and other features. Thread safety of HTTP clients depends on the implementation and configuration of the specific client.

关于java - 如何在屏幕抓取时使用 cookie?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10662539/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com