简体   繁体   English

如何使用Java登录到Imdb pro Page?

[英]How can I log into Imdb pro Page Using Java?

I want to take some metadata using my imdb pro account. 我想使用我的imdb专业版帐户获取一些元数据。

The page that I'm going to look for is this: 我要查找的页面是这样的:

https://pro-labs.imdb.com/title/{IMDB ID}

I try to open the link with Jsoup, but it returns the following error: 我尝试使用Jsoup打开链接,但返回以下错误:

java.io.IOException: 403 error loading URL http://pro.imdb.com/signup/v4/login?u=https://pro-labs.imdb.com/title/ {IMDB ID}. java.io.IOException:403错误,加载URL http://pro.imdb.com/signup/v4/login?u=https://pro-labs.imdb.com/title/ {IMDB ID}。

This is because I am not logged. 这是因为我没有登录。

This is the login page: https://secure.imdb.com/signup/v4/login . 这是登录页面: https : //secure.imdb.com/signup/v4/login

How can I make a request to include my log in info? 我如何请求包含我的登录信息?

Jsoup is has only a limited support of login / authentication. Jsoup仅对登录/身份验证提供有限支持。 Better you use another library (recommendation: Apache HttpClient ) to do this. 最好使用另一个库(推荐: Apache HttpClient )来执行此操作。

In general you then can do these steps: 通常,您可以执行以下步骤:

  1. Login using eg. 使用例如登录 HttpClient HttpClient
  2. Download the websitde into a buffer 将websitde 下载到缓冲区
  3. Parse this buffer using jsoup 使用jsoup 解析此缓冲区
  4. Process the content as required 根据需要处理内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM