- requests https://pypi.org/project/requests/
- beautifulsoup4 https://pypi.org/project/beautifulsoup4/
- rich (only for examples) https://pypi.org/project/rich/
Install with:
python -m pip install requests beautifulsoup4 rich
There are 3 examples that show basic usage of the scraper.
- search_movie.py - searches IMDb for a movie
- top250_movies.py - scrapes the top 250 movies
- show_movie_details.py - scrapes the full details of a movie
Returns list of top 250 movies
-
Return type
list
[Movie
]
Searches imdb for movies/actors matching query.
-
Parameters
-
query (
str
) – string to search for -
n (
int
) – number of results to return -
titles (
bool
) – whether to search for titles -
actors (
bool
) – whether to search for actors
-
-
Return type
dict
[str
,list
] -
Returns
dict of lists of Movie/Actor objects
Bases: imdb_scraper.Base
Class holding information about movie. If you want to load credits, set load_credits to True or load them manually with Movie.read_fullcredits()
-
Parameters
-
movie_id – id of movie (e.g. “tt0111161”)
-
load_credits (
bool
) – if True, credits will be loaded from site (default: False)
-
Call this if you want to manually load data from site
Bases: imdb_scraper.Base
Call this if you want to manually load data from site