可以通过 POST/下载 CAPTCHA 的网站进行身份验证
我经常想创建一个应用程序,为其他网站提供更简单的前端,这些网站要求用户登录才能访问我想要使用的页面。我想知道,如果
(1) 任何具有 POST 到 http 页面的网站都可以通过 POST
postField1name=pf1Value&postField2name=pf2Value
到该网站进行身份验证,如果是这样,您如何正确检查要 POST 的 HTML?
(2) 我想知道您是否可以解析 HTML(例如注册表单)并显示应用程序 UI 中的所有字段,包括下载验证码并将其显示给用户,并允许他们在其中键入值,发送回网站,并处理响应。
另外,如果有人知道我如何在 java 中使用 Apache HTTP Client 来完成 (2),我将非常感激!
http://hc.apache.org/httpcomponents-client/httpclient/index.html html
I've often wanted to create applications that provide a simpler front-end to other websites that require users to login before the pages I want to use can be accessed. I was wondering, if
(1) any website with a POST to an http page can be authenticated by POSTing
postField1name=pf1Value&postField2name=pf2Value
to the website, if that's true how can you inspect the HTML to POST correctly?
(2) I wanted to know if you could parse HTML, say for a sign up form, and display all the fields in an application UI, including downloading a Captcha, and displaying it to the user, and allowing them to type the value in, to send back to the website, and process the response.
Also if anyone knows how I might accomplish (2) using Apache HTTP Client in java, I'd greatly appreciate it!
http://hc.apache.org/httpcomponents-client/httpclient/index.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(1) 找出实际 POST 内容的一个简单方法是查看实际的 HTTP 请求。您可以使用 LiveHTTPHeaders 之类的工具来完成此操作。然后让你的脚本模拟它。
(2)是的。您可以使用 cURL,这对于此类事情非常有用。
(1) An easy way to find out what's actually being POST'd is to look at the actual HTTP requests. You can do that with a tool like LiveHTTPHeaders. Then have your script simulate that.
(2) Yes. You can use cURL, which is excellent for things like this.
(1) 尝试FireBug。实际上有很多身份验证选项。
(2)尝试 JTidy
(1) Try FireBug. There's actually a lot of options for authentication.
(2) Try JTidy