带有httpclient的post方法的java脚本
我正在尝试使用java中的httpclient登录yahoo.de(我正在抓取该网站)。要提交包含用户名和密码的表单,我使用 Postmethod。我发现我必须在 post 方法中传递一些隐藏值(动态生成)以及用户名和密码。有人知道我该怎么做吗?如何使用 httpclient 处理 javascript?任何帮助将不胜感激!
I am trying to login to yahoo.de with httpclient in java (I am crawling the site). To submit a form having username and password, I use Postmethod. I found that I have to pass some hidden values (which are generated dynamically) along with username and password in post method. Does anybody know how do I do this ? How do I handle javascript with httpclient ? Any help would be appreciated !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑 HTTPClient 是否支持 java 脚本,您可能必须在页面中查找 Yahoo 是否支持非 javascript 登录过程,并掌握这些字段以进行登录。
否则,使用 yahoo 的 open-id API 来验证用户身份。更多信息请参见:http://developer.yahoo.com/openid/
I doubt HTTPClient would support java-script, you might have to find if Yahoo supports non-javascript login process in the page and grasp those fields to login through.
Otherwise use, yahoo's open-id API to authenticate the user. More information here: http://developer.yahoo.com/openid/