Search code examples
javajsoupimdb

How can I log into Imdb pro Page Using Java?


I want to take some metadata using my imdb pro account.

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:

java.io.IOException: 403 error loading 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.

How can I make a request to include my log in info?


Solution

  • Jsoup is has only a limited support of login / authentication. Better you use another library (recommendation: Apache HttpClient) to do this.

    In general you then can do these steps:

    1. Login using eg. HttpClient
    2. Download the websitde into a buffer
    3. Parse this buffer using jsoup
    4. Process the content as required