Alex S
Alex S

Reputation: 4884

How do I get the IMDB url from IMDBPy?

I've been using IMDBpy to collect information about movies with python. While for the most part it works great, I can't figure out how to get it to tell me the IMDB url of the movie returned from a search. Is it even possible with IMDBpy?

Thanks a lot, Alex

Edit: On Aya's instructions, I used the get_imdbURL() method like this:

import imdb
movie = "some movie"
ia = imdb.IMDb()
results = ia.search_movie(movie)
mv = results[0] #First result
URL = ia.get_imdbURL(mv) #URL for first result

Thanks again Aya.

Upvotes: 3

Views: 2884

Answers (1)

Aya
Aya

Reputation: 41950

From the docs...

The get_imdbURL(MovieOrPersonOrCharacterOrCompanyObject) method returns a string with the main IMDb URL for the given Movie, Person, Character or Company object; it tries to do its best to retrieve the URL.

Upvotes: 4

Related Questions