Friday, October 24, 2025
HomeLanguagesPython IMDbPY – Series Information in XML format

Python IMDbPY – Series Information in XML format

In this article we will see how we can get the company information in the XML format. Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. Series object contains all the information about the all the episodes and seasons that has records at IMDb data base.
 

In order to get this we have to do the following 
1. Import the IMDbPY module 
2. Create a instance of IMDB 
3. Get the series object with the help of series ID 
4. Get the XML format value here it will be in string by converting the series object into XML 
 

Below is the implementation 

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# id
code = "6473300"
   
# getting information
series = ia.get_movie(code)
   
# printing title
print(series.data['title'])
 
print("--------------------------------")
 
# converting series object into XML file
xml_file = series.asXML()
 
# printing some part of the XML file
print(xml_file[:100])


Output : 
 

Mirzapur
--------------------------------
<?xml version="1.0"?
<!DOCTYPE movie SYSTEM "http://imdbpy.sf.net/dtd/imdbpy68.dtd"

<movie id="64

Another example 
 

Python3




# importing the module
import imdb
  
# creating instance of IMDb
ia = imdb.IMDb()
  
# id
code = "6077448"
   
# getting information
series = ia.get_movie(code)
   
# printing title
print(series.data['title'])
 
print("--------------------------------")
 
# converting series object into XML file
xml_file = series.asXML()
 
# printing some part of the XML file
print(xml_file[:100])


Output : 
 

Sacred Games
--------------------------------
<?xml version="1.0"?
<!DOCTYPE movie SYSTEM "http://imdbpy.sf.net/dtd/imdbpy68.dtd"

<movie id="60

 

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

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS