pythonweb-scrapingimdbimdbpy

How can I scrape data of ```title``` and ```genres``` in Russian?


Here is my code, so how can I scrap data of title and genres in Russian or any other language (now I have it in English)?

from imdb import IMDb

def scrape_movie_info(movie_id):
    ia = IMDb('http', useModule='http')
    movie = ia.get_movie(movie_id)#

    print("Название: ", movie["title"])
    print("Рейтинг: ", movie["rating"])
    print("Жанры: ", movie["genres"])
    print("Описание: ", movie["plot outline"])#

movie_id = "20225374"
scrape_movie_info(movie_id)

Solution

  • There seem to be multiple fields:

    Then according to a feature request in their issue tracker, https://github.com/cinemagoer/cinemagoer/issues/329, you can specify preferred languages in the initialization,

    ia = imdb.IMDb('https', languages='it-IT')
    

    is the example there, and it presumably becomes

    ia = IMDb('http', useModule='http', languages='ru-RU')
    

    when applied to your particular code.