Thursday, December 26, 2024
Google search engine
HomeLanguagesPython IMDbPY – Searching keyword

Python IMDbPY – Searching keyword

In this article we will see how we can search a keyword in the IMDb database.
Keyword : It is a word (or group of connected words) attached to a title (movie / TV series / TV episode) to describe any notable object, concept, style or action that takes place during a title. The main purpose of keywords is to allow visitors to easily search and discover titles.

In order to search a key word we will use search_keyword method. 

Syntax : imdb_object.search_keyword(keyword)
Argument : It takes string as argument which is keyword
Return : It returns list. 
 

Below is the implementation.  

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# keyword
keyword = "Delhi"
  
# searching keyword
search = ia.search_keyword(keyword)
 
# printing the search 
print(search)


Output : 

['delhi', 'delhi-india', 'delhi-university', 'delhi-police', 'delhi-metro', 'delhi-gang-rape', 'new-delhi', 'old-delhi', 'flight-to-delhi', 'new-delhi-india', 'golden-temple-new-delhi', 'reference-to-new-delhi', 'india-gate-new-delhi', 'qutub-minar-delhi', 'chapel-hill', 'drexel-hill', 'institute-for-international-studies-new-delhi', 'model-home', 'model-hobby', 'model-heart', 'model-husband', 'scale-model-house', 'stadelheim-prison', 'reference-to-miguel-hidalgo', 'model-24-stielhandgranate', 'drug-cartel-hid-the-records-in-the-back-of-a-painting', 'university-of-north-carolina-at-chapel-hill', 'reference-to-michael-hinky-dink-kenna', "bazar-de-l'hotel-de-ville-paris", "reference-to-le-musee-de-l'homme-paris"]

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# keyword
keyword = "avengers tower"
  
# searching keyword
search = ia.search_keyword(keyword)
 
# printing the search 
print(search)


Output : 

['avengers-tower']

 

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments