Skip to content
Related Articles

Related Articles

Python IMDbPY – Searching a person

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 18 Jan, 2022

IMDbPY is a Python package which is used to retrieve and manage the data of the IMDb. In this article we will see how we can search a person with the given name in the IMDb data base, we can do to this with the help of search_person method. 
 

Syntax : imdb_object.search_person(name)
Argument : It takes string as argument, which is the name of person related to film industry.
Return : It return list, items in list have same or similar name to the searched name. 
 

Below is the implementation 
 

Python3




# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# name of the person
name = "Akshay Kumar"
 
# searching the name of the person
search = ia.search_person(name)
 
# printing the result
for i in search :
    print(i)


Output : 
 

Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar Parija
Akshay Kumar Saxena
Akshay Kumar Pradhan
Akshay Kumar
Akshay Kumar Patil
Lakshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Akshay Kumar
Lakshay Kumar
Akshay Kumar Ahitan
Akshay Kumar Rahi
Akshay Kumar Boral
Akshaykumar Patil
Akshay Kumar Sharma

Another example os searching a person 
 

Python3




# importing the module
import imdb
 
# creating instance of IMDb
ia = imdb.IMDb()
 
# name of the person
name = "Neil nitin mukesh"
 
# searching the name of the person
search = ia.search_person(name)
 
# printing the result
print(search)


Output : 
 

[Person id:1778703[http] name:_Neil Nitin Mukesh_, Person id:1042471[http] name:_Nitin Mukesh (II)_, Person id:5068738[http] name:_Naman Nitin Mukesh_, Person id:0611482[http] name:_Nitin Mukesh (I)_]

 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!