In this article we will see how we can get the name of movie company from the searched list of companies, we use search_company method to find all the related companies.
search_company method returns list and each element of list work as a dictionary i.e. they can be queried by giving the key of the data, here key will be name.
Syntax : companies[0][‘name’]
Here companies is the list return by search_company method and companies[0] refer to the first element of list.
Return : It returns string i.e name.
Below is the implementation:
# importing the module import imdb # creating instance of IMDb ia = imdb.IMDb() # name of the company name = "Universal Studios Hollywood" # searching the name of the company search = ia.search_company(name) # printing the search print(search) # printing the name for i in range(len(search)): print(search[i]['name']) |
Output :
[Company id:0017927[http] name:_Universal Studios Hollywood [us]_] Universal Studios Hollywood
Another example
# importing the module import imdb # creating instance of IMDb ia = imdb.IMDb() # name of the company name = "Walt Disney" # searching the name of the company search = ia.search_company(name) # printing the name for i in range(len(search)): print(search[i]['name']) |
Output :
Walt Disney Studios Motion Pictures Walt Disney Pictures Walt Disney Studios Motion Pictures Walt Disney Studios Walt Disney Animation Studios The Walt Disney Company Walt Disney Company Walt Disney Company Walt Disney Television Walt Disney Home Video Walt Disney Home Video Walt Disney Productions Walt Disney Company Nordic Walt Disney Company Walt Disney Attractions The Walt Disney Company Walt Disney Animation U.K. Walt Disney Motion Pictures Group Walt Disney Company Walt Disney International
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
Recommended Posts:
- Python IMDbPY – Getting Person name from searched name
- Python IMDbPY – Getting company ID from searched companies
- Python IMDbPY – Getting title from searched movie
- Python IMDbPY – Getting person ID from searched persons
- Python IMDbPY – Getting movie ID from searched movies
- Python IMDbPY – Retrieving company using company ID
- Python IMDbPY – Adding info set to the searched persons
- Python IMDbPY – Adding info set to the searched movies
- Python IMDbPY – Default info of Company object
- Python IMDbPY – Company info set
- Python IMDbPY – Searching a company
- Python IMDbPY – Company Information in XML format
- Python IMDbPY – Get each episode name of each season of the series
- Python IMDbPY – Get series name from the episode
- Python IMDbPY – Getting released year of movie from movie object
- Python IMDbPY – Getting bottom 100 movies
- Python IMDbPY – Getting top 250 movies
- Python IMDbPY – Getting birth date of person
- Python IMDbPY - Getting list of movies performed by the actor
- Python IMDbPY - Getting birth place of person
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

