w3resource
Python Web Scraping Exercises

Python Web Scraping: Download IMDB's Top 250 data

Python Web Scraping: Exercise-23 with Solution

Write a Python program to download IMDB's Top 250 data (movie name, Initial release, director name and stars).

Sample Solution:-

Python Code:

#https://bit.ly/2NyxdAG
from bs4 import BeautifulSoup
import requests
import re

# Download IMDB's Top 250 data
url = 'http://www.imdb.com/chart/top'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')

movies = soup.select('td.titleColumn')
links = [a.attrs.get('href') for a in soup.select('td.titleColumn a')]
crew = [a.attrs.get('title') for a in soup.select('td.titleColumn a')]
ratings = [b.attrs.get('data-value') for b in soup.select('td.posterColumn span[name=ir]')]
votes = [b.attrs.get('data-value') for b in soup.select('td.ratingColumn strong')]

imdb = []

# Store each item into dictionary (data), then put those into a list (imdb)
for index in range(0, len(movies)):
    # Seperate movie into: 'place', 'title', 'year'
    movie_string = movies[index].get_text()
    movie = (' '.join(movie_string.split()).replace('.', ''))
    movie_title = movie[len(str(index))+1:-7]
    year = re.search('\((.*?)\)', movie_string).group(1)
    place = movie[:len(str(index))-(len(movie))]
    data = {"movie_title": movie_title,
            "year": year,
            "place": place,
            "star_cast": crew[index],
            "rating": ratings[index],
            "vote": votes[index],
            "link": links[index]}
    imdb.append(data)

for item in imdb:
    print(item['place'], '-', item['movie_title'], '('+item['year']+') -', 'Starring:', item['star_cast'])
  
 

Output

1 - The Shawshank Redemption (1994) - Starring: Frank Darabont (dir.), Tim Robbins, Morgan Freeman
2 - The Godfather (1972) - Starring: Francis Ford Coppola (dir.), Marlon Brando, Al Pacino
3 - The Godfather: Part II (1974) - Starring: Francis Ford Coppola (dir.), Al Pacino, Robert De Niro
4 - The Dark Knight (2008) - Starring: Christopher Nolan (dir.), Christian Bale, Heath Ledger
5 - 12 Angry Men (1957) - Starring: Sidney Lumet (dir.), Henry Fonda, Lee J. Cobb
6 - Schindler's List (1993) - Starring: Steven Spielberg (dir.), Liam Neeson, Ralph Fiennes
7 - The Lord of the Rings: The Return of the King (2003) - Starring: Peter Jackson (dir.), Elijah Wood, Viggo Mortensen
8 - Pulp Fiction (1994) - Starring: Quentin Tarantino (dir.), John Travolta, Uma Thurman
9 - The Good, the Bad and the Ugly (1966) - Starring: Sergio Leone (dir.), Clint Eastwood, Eli Wallach
1 -  Fight Club (1999) - Starring: David Fincher (dir.), Brad Pitt, Edward Norton
11 - The Lord of the Rings: The Fellowship of the Ring (2001) - Starring: Peter Jackson (dir.), Elijah Wood, Ian McKellen
12 - Forrest Gump (1994) - Starring: Robert Zemeckis (dir.), Tom Hanks, Robin Wright
13 - Star Wars: Episode V - The Empire Strikes Back (1980) - Starring: Irvin Kershner (dir.), Mark Hamill, Harrison Ford
14 - Inception (2010) - Starring: Christopher Nolan (dir.), Leonardo DiCaprio, Joseph Gordon-Levitt
15 - The Lord of the Rings: The Two Towers (2002) - Starring: Peter Jackson (dir.), Elijah Wood, Ian McKellen
16 - One Flew Over the Cuckoo's Nest (1975) - Starring: Milos Forman (dir.), Jack Nicholson, Louise Fletcher
17 - Goodfellas (1990) - Starring: Martin Scorsese (dir.), Robert De Niro, Ray Liotta
18 - The Matrix (1999) - Starring: Lana Wachowski (dir.), Keanu Reeves, Laurence Fishburne
19 - Seven Samurai (1954) - Starring: Akira Kurosawa (dir.), Toshirô Mifune, Takashi Shimura
20 - Avengers: Infinity War (2018) - Starring: Anthony Russo (dir.), Robert Downey Jr., Chris Hemsworth
21 - City of God (2002) - Starring: Fernando Meirelles (dir.), Alexandre Rodrigues, Leandro Firmino
22 - Star Wars: Episode IV - A New Hope (1977) - Starring: George Lucas (dir.), Mark Hamill, Harrison Ford
23 - Se7en (1995) - Starring: David Fincher (dir.), Morgan Freeman, Brad Pitt
24 - The Silence of the Lambs (1991) - Starring: Jonathan Demme (dir.), Jodie Foster, Anthony Hopkins
25 - It's a Wonderful Life (1946) - Starring: Frank Capra (dir.), James Stewart, Donna Reed
26 - Life Is Beautiful (1997) - Starring: Roberto Benigni (dir.), Roberto Benigni, Nicoletta Braschi
27 - The Usual Suspects (1995) - Starring: Bryan Singer (dir.), Kevin Spacey, Gabriel Byrne
28 - Spirited Away (2001) - Starring: Hayao Miyazaki (dir.), Daveigh Chase, Suzanne Pleshette
29 - Saving Private Ryan (1998) - Starring: Steven Spielberg (dir.), Tom Hanks, Matt Damon
30 - Léon: The Professional (1994) - Starring: Luc Besson (dir.), Jean Reno, Gary Oldman
31 - The Green Mile (1999) - Starring: Frank Darabont (dir.), Tom Hanks, Michael Clarke Duncan
32 - Interstellar (2014) - Starring: Christopher Nolan (dir.), Matthew McConaughey, Anne Hathaway
33 - American History X (1998) - Starring: Tony Kaye (dir.), Edward Norton, Edward Furlong
34 - Psycho (1960) - Starring: Alfred Hitchcock (dir.), Anthony Perkins, Janet Leigh
35 - City Lights (1931) - Starring: Charles Chaplin (dir.), Charles Chaplin, Virginia Cherrill
36 - Once Upon a Time in the West (1968) - Starring: Sergio Leone (dir.), Henry Fonda, Charles Bronson
37 - Casablanca (1942) - Starring: Michael Curtiz (dir.), Humphrey Bogart, Ingrid Bergman
38 - Modern Times (1936) - Starring: Charles Chaplin (dir.), Charles Chaplin, Paulette Goddard
39 - The Intouchables (2011) - Starring: Olivier Nakache (dir.), François Cluzet, Omar Sy
40 - The Pianist (2002) - Starring: Roman Polanski (dir.), Adrien Brody, Thomas Kretschmann
41 - The Departed (2006) - Starring: Martin Scorsese (dir.), Leonardo DiCaprio, Matt Damon
42 - Terminator 2 (1991) - Starring: James Cameron (dir.), Arnold Schwarzenegger, Linda Hamilton
43 - Back to the Future (1985) - Starring: Robert Zemeckis (dir.), Michael J. Fox, Christopher Lloyd
44 - Raiders of the Lost Ark (1981) - Starring: Steven Spielberg (dir.), Harrison Ford, Karen Allen
45 - Rear Window (1954) - Starring: Alfred Hitchcock (dir.), James Stewart, Grace Kelly
46 - Whiplash (2014) - Starring: Damien Chazelle (dir.), Miles Teller, J.K. Simmons
47 - Gladiator (2000) - Starring: Ridley Scott (dir.), Russell Crowe, Joaquin Phoenix
48 - The Lion King (1994) - Starring: Roger Allers (dir.), Matthew Broderick, Jeremy Irons
49 - The Prestige (2006) - Starring: Christopher Nolan (dir.), Christian Bale, Hugh Jackman
50 - Memento (2000) - Starring: Christopher Nolan (dir.), Guy Pearce, Carrie-Anne Moss
51 - Apocalypse Now (1979) - Starring: Francis Ford Coppola (dir.), Martin Sheen, Marlon Brando
52 - Alien (1979) - Starring: Ridley Scott (dir.), Sigourney Weaver, Tom Skerritt
53 - The Great Dictator (1940) - Starring: Charles Chaplin (dir.), Charles Chaplin, Paulette Goddard
54 - Cinema Paradiso (1988) - Starring: Giuseppe Tornatore (dir.), Philippe Noiret, Enzo Cannavale
55 - Grave of the Fireflies (1988) - Starring: Isao Takahata (dir.), Tsutomu Tatsumi, Ayano Shiraishi
56 - Sunset Blvd (1950) - Starring: Billy Wilder (dir.), William Holden, Gloria Swanson
57 - Dr Strangelove or: How I Learned to Stop Worrying and Love the Bomb (1964) - Starring: Stanley Kubrick (dir.), Peter Sellers, George C. Scott
58 - The Lives of Others (2006) - Starring: Florian Henckel von Donnersmarck (dir.), Ulrich Mühe, Martina Gedeck
59 - Paths of Glory (1957) - Starring: Stanley Kubrick (dir.), Kirk Douglas, Ralph Meeker
60 - The Shining (1980) - Starring: Stanley Kubrick (dir.), Jack Nicholson, Shelley Duvall
61 - Django Unchained (2012) - Starring: Quentin Tarantino (dir.), Jamie Foxx, Christoph Waltz
62 - WALL·E (2008) - Starring: Andrew Stanton (dir.), Ben Burtt, Elissa Knight
63 - Coco (2017) - Starring: Lee Unkrich (dir.), Anthony Gonzalez, Gael García Bernal
64 - Princess Mononoke (1997) - Starring: Hayao Miyazaki (dir.), Yôji Matsuda, Yuriko Ishida
65 - American Beauty (1999) - Starring: Sam Mendes (dir.), Kevin Spacey, Annette Bening
66 - The Dark Knight Rises (2012) - Starring: Christopher Nolan (dir.), Christian Bale, Tom Hardy
67 - Witness for the Prosecution (1957) - Starring: Billy Wilder (dir.), Tyrone Power, Marlene Dietrich
68 - Oldeuboi (2003) - Starring: Chan-wook Park (dir.), Min-sik Choi, Ji-tae Yu
69 - Aliens (1986) - Starring: James Cameron (dir.), Sigourney Weaver, Michael Biehn
70 - Once Upon a Time in America (1984) - Starring: Sergio Leone (dir.), Robert De Niro, James Woods
71 - Das Boot (1981) - Starring: Wolfgang Petersen (dir.), Jürgen Prochnow, Herbert Grönemeyer
72 - Citizen Kane (1941) - Starring: Orson Welles (dir.), Orson Welles, Joseph Cotten
73 - Vertigo (1958) - Starring: Alfred Hitchcock (dir.), James Stewart, Kim Novak
74 - North by Northwest (1959) - Starring: Alfred Hitchcock (dir.), Cary Grant, Eva Marie Saint
75 - Braveheart (1995) - Starring: Mel Gibson (dir.), Mel Gibson, Sophie Marceau
76 - Reservoir Dogs (1992) - Starring: Quentin Tarantino (dir.), Harvey Keitel, Tim Roth
77 - Star Wars: Episode VI - Return of the Jedi (1983) - Starring: Richard Marquand (dir.), Mark Hamill, Harrison Ford
78 - Kimi no na wa (2016) - Starring: Makoto Shinkai (dir.), Ryûnosuke Kamiki, Mone Kamishiraishi
79 - M (1931) - Starring: Fritz Lang (dir.), Peter Lorre, Ellen Widmann
80 - Dangal (2016) - Starring: Nitesh Tiwari (dir.), Aamir Khan, Sakshi Tanwar
81 - Requiem for a Dream (2000) - Starring: Darren Aronofsky (dir.), Ellen Burstyn, Jared Leto
82 - Amadeus (1984) - Starring: Milos Forman (dir.), F. Murray Abraham, Tom Hulce
83 - Taare Zameen Par (2007) - Starring: Aamir Khan (dir.), Darsheel Safary, Aamir Khan
84 - Amélie (2001) - Starring: Jean-Pierre Jeunet (dir.), Audrey Tautou, Mathieu Kassovitz
85 - Lawrence of Arabia (1962) - Starring: David Lean (dir.), Peter O'Toole, Alec Guinness
86 - A Clockwork Orange (1971) - Starring: Stanley Kubrick (dir.), Malcolm McDowell, Patrick Magee
87 - Eternal Sunshine of the Spotless Mind (2004) - Starring: Michel Gondry (dir.), Jim Carrey, Kate Winslet
88 - Double Indemnity (1944) - Starring: Billy Wilder (dir.), Fred MacMurray, Barbara Stanwyck
89 - Taxi Driver (1976) - Starring: Martin Scorsese (dir.), Robert De Niro, Jodie Foster
90 - 2001: A Space Odyssey (1968) - Starring: Stanley Kubrick (dir.), Keir Dullea, Gary Lockwood
91 - 3 Idiots (2009) - Starring: Rajkumar Hirani (dir.), Aamir Khan, Madhavan
92 - Toy Story (1995) - Starring: John Lasseter (dir.), Tom Hanks, Tim Allen
93 - Singin' in the Rain (1952) - Starring: Stanley Donen (dir.), Gene Kelly, Donald O'Connor
94 - Full Metal Jacket (1987) - Starring: Stanley Kubrick (dir.), Matthew Modine, R. Lee Ermey
95 - To Kill a Mockingbird (1962) - Starring: Robert Mulligan (dir.), Gregory Peck, John Megna
96 - Inglourious Basterds (2009) - Starring: Quentin Tarantino (dir.), Brad Pitt, Diane Kruger
97 - Bicycle Thieves (1948) - Starring: Vittorio De Sica (dir.), Lamberto Maggiorani, Enzo Staiola
98 - The Sting (1973) - Starring: George Roy Hill (dir.), Paul Newman, Robert Redford
99 - The Kid (1921) - Starring: Charles Chaplin (dir.), Charles Chaplin, Edna Purviance
10 -  Toy Story 3 (2010) - Starring: Lee Unkrich (dir.), Tom Hanks, Tim Allen
101 - Good Will Hunting (1997) - Starring: Gus Van Sant (dir.), Robin Williams, Matt Damon
102 - Snatch (2000) - Starring: Guy Ritchie (dir.), Jason Statham, Brad Pitt
103 - Jagten (2012) - Starring: Thomas Vinterberg (dir.), Mads Mikkelsen, Thomas Bo Larsen
104 - Monty Python and the Holy Grail (1975) - Starring: Terry Gilliam (dir.), Graham Chapman, John Cleese
105 - For a Few Dollars More (1965) - Starring: Sergio Leone (dir.), Clint Eastwood, Lee Van Cleef
106 - Scarface (1983) - Starring: Brian De Palma (dir.), Al Pacino, Michelle Pfeiffer
107 - LA Confidential (1997) - Starring: Curtis Hanson (dir.), Kevin Spacey, Russell Crowe
108 - The Apartment (1960) - Starring: Billy Wilder (dir.), Jack Lemmon, Shirley MacLaine
109 - Metropolis (1927) - Starring: Fritz Lang (dir.), Brigitte Helm, Alfred Abel
110 - A Separation (2011) - Starring: Asghar Farhadi (dir.), Payman Maadi, Leila Hatami
111 - Rashômon (1950) - Starring: Akira Kurosawa (dir.), Toshirô Mifune, Machiko Kyô
112 - Indiana Jones and the Last Crusade (1989) - Starring: Steven Spielberg (dir.), Harrison Ford, Sean Connery
113 - Up (2009) - Starring: Pete Docter (dir.), Edward Asner, Jordan Nagai
114 - Yojimbo (1961) - Starring: Akira Kurosawa (dir.), Toshirô Mifune, Eijirô Tôno
115 - All About Eve (1950) - Starring: Joseph L. Mankiewicz (dir.), Bette Davis, Anne Baxter
116 - Batman Begins (2005) - Starring: Christopher Nolan (dir.), Christian Bale, Michael Caine
117 - Some Like It Hot (1959) - Starring: Billy Wilder (dir.), Marilyn Monroe, Tony Curtis
118 - Unforgiven (1992) - Starring: Clint Eastwood (dir.), Clint Eastwood, Gene Hackman
119 - The Treasure of the Sierra Madre (1948) - Starring: John Huston (dir.), Humphrey Bogart, Walter Huston
120 - Downfall (2004) - Starring: Oliver Hirschbiegel (dir.), Bruno Ganz, Alexandra Maria Lara
121 - Die Hard (1988) - Starring: John McTiernan (dir.), Bruce Willis, Alan Rickman
122 - Heat (1995) - Starring: Michael Mann (dir.), Al Pacino, Robert De Niro
123 - Babam ve Oglum (2005) - Starring: Çagan Irmak (dir.), Çetin Tekindor, Fikret Kuskan
124 - Raging Bull (1980) - Starring: Martin Scorsese (dir.), Robert De Niro, Cathy Moriarty
125 - Ikiru (1952) - Starring: Akira Kurosawa (dir.), Takashi Shimura, Nobuo Kaneko
126 - The Great Escape (1963) - Starring: John Sturges (dir.), Steve McQueen, James Garner
127 - Incendies (2010) - Starring: Denis Villeneuve (dir.), Lubna Azabal, Mélissa Désormeaux-Poulin
128 - The Third Man (1949) - Starring: Carol Reed (dir.), Orson Welles, Joseph Cotten
129 - Children of Heaven (1997) - Starring: Majid Majidi (dir.), Mohammad Amir Naji, Amir Farrokh Hashemian
130 - Pan's Labyrinth (2006) - Starring: Guillermo del Toro (dir.), Ivana Baquero, Ariadna Gil
131 - Chinatown (1974) - Starring: Roman Polanski (dir.), Jack Nicholson, Faye Dunaway
132 - My Neighbor Totoro (1988) - Starring: Hayao Miyazaki (dir.), Hitoshi Takagi, Noriko Hidaka
133 - Three Billboards Outside Ebbing, Missouri (2017) - Starring: Martin McDonagh (dir.), Frances McDormand, Woody Harrelson
134 - Judgment at Nuremberg (1961) - Starring: Stanley Kramer (dir.), Spencer Tracy, Burt Lancaster
135 - Ran (1985) - Starring: Akira Kurosawa (dir.), Tatsuya Nakadai, Akira Terao
136 - Howl's Moving Castle (2004) - Starring: Hayao Miyazaki (dir.), Chieko Baishô, Takuya Kimura
137 - The Secret in Their Eyes (2009) - Starring: Juan José Campanella (dir.), Ricardo Darín, Soledad Villamil
138 - The Gold Rush (1925) - Starring: Charles Chaplin (dir.), Charles Chaplin, Mack Swain
139 - The Bridge on the River Kwai (1957) - Starring: David Lean (dir.), William Holden, Alec Guinness
140 - On the Waterfront (1954) - Starring: Elia Kazan (dir.), Marlon Brando, Karl Malden
141 - Lock, Stock and Two Smoking Barrels (1998) - Starring: Guy Ritchie (dir.), Jason Flemyng, Dexter Fletcher
142 - A Beautiful Mind (2001) - Starring: Ron Howard (dir.), Russell Crowe, Ed Harris
143 - The Seventh Seal (1957) - Starring: Ingmar Bergman (dir.), Max von Sydow, Gunnar Björnstrand
144 - Inside Out (2015) - Starring: Pete Docter (dir.), Amy Poehler, Bill Hader
145 - Casino (1995) - Starring: Martin Scorsese (dir.), Robert De Niro, Sharon Stone
146 - Room (2015) - Starring: Lenny Abrahamson (dir.), Brie Larson, Jacob Tremblay
147 - Mr Smith Goes to Washington (1939) - Starring: Frank Capra (dir.), James Stewart, Jean Arthur
148 - The Elephant Man (1980) - Starring: David Lynch (dir.), Anthony Hopkins, John Hurt
149 - The Wolf of Wall Street (2013) - Starring: Martin Scorsese (dir.), Leonardo DiCaprio, Jonah Hill
150 - V for Vendetta (2005) - Starring: James McTeigue (dir.), Hugo Weaving, Natalie Portman
151 - Blade Runner (1982) - Starring: Ridley Scott (dir.), Harrison Ford, Rutger Hauer
152 - Warrior (2011) - Starring: Gavin O'Connor (dir.), Tom Hardy, Nick Nolte
153 - Wild Strawberries (1957) - Starring: Ingmar Bergman (dir.), Victor Sjöström, Bibi Andersson
154 - The General (1926) - Starring: Clyde Bruckman (dir.), Buster Keaton, Marion Mack
155 - Dial M for Murder (1954) - Starring: Alfred Hitchcock (dir.), Ray Milland, Grace Kelly
156 - Trainspotting (1996) - Starring: Danny Boyle (dir.), Ewan McGregor, Ewen Bremner
157 - No Country for Old Men (2007) - Starring: Ethan Coen (dir.), Tommy Lee Jones, Javier Bardem
158 - Gone with the Wind (1939) - Starring: Victor Fleming (dir.), Clark Gable, Vivien Leigh
159 - Sherlock Jr (1924) - Starring: Buster Keaton (dir.), Buster Keaton, Kathryn McGuire
160 - The Sixth Sense (1999) - Starring: M. Night Shyamalan (dir.), Bruce Willis, Haley Joel Osment
161 - There Will Be Blood (2007) - Starring: Paul Thomas Anderson (dir.), Daniel Day-Lewis, Paul Dano
162 - Gran Torino (2008) - Starring: Clint Eastwood (dir.), Clint Eastwood, Bee Vang
163 - Fargo (1996) - Starring: Joel Coen (dir.), William H. Macy, Frances McDormand
164 - The Deer Hunter (1978) - Starring: Michael Cimino (dir.), Robert De Niro, Christopher Walken
165 - The Thing (1982) - Starring: John Carpenter (dir.), Kurt Russell, Wilford Brimley
166 - Finding Nemo (2003) - Starring: Andrew Stanton (dir.), Albert Brooks, Ellen DeGeneres
167 - The Big Lebowski (1998) - Starring: Joel Coen (dir.), Jeff Bridges, John Goodman
168 - Come and See (1985) - Starring: Elem Klimov (dir.), Aleksey Kravchenko, Olga Mironova
169 - Kill Bill: Vol 1 (2003) - Starring: Quentin Tarantino (dir.), Uma Thurman, David Carradine
170 - Cool Hand Luke (1967) - Starring: Stuart Rosenberg (dir.), Paul Newman, George Kennedy
171 - Incredibles 2 (2018) - Starring: Brad Bird (dir.), Craig T. Nelson, Holly Hunter
172 - Rebecca (1940) - Starring: Alfred Hitchcock (dir.), Laurence Olivier, Joan Fontaine
173 - Shutter Island (2010) - Starring: Martin Scorsese (dir.), Leonardo DiCaprio, Emily Mortimer
174 - Sunrise (1927) - Starring: F.W. Murnau (dir.), George O'Brien, Janet Gaynor
175 - Tokyo Story (1953) - Starring: Yasujirô Ozu (dir.), Chishû Ryû, Chieko Higashiyama
176 - Hacksaw Ridge (2016) - Starring: Mel Gibson (dir.), Andrew Garfield, Sam Worthington
177 - Mary and Max (2009) - Starring: Adam Elliot (dir.), Toni Collette, Philip Seymour Hoffman
178 - How to Train Your Dragon (2010) - Starring: Dean DeBlois (dir.), Jay Baruchel, Gerard Butler
179 - Gone Girl (2014) - Starring: David Fincher (dir.), Ben Affleck, Rosamund Pike
180 - The Bandit (1996) - Starring: Yavuz Turgul (dir.), Sener Sen, Ugur Yücel
181 - Relatos salvajes (2014) - Starring: Damián Szifron (dir.), Darío Grandinetti, María Marull
182 - Into the Wild (2007) - Starring: Sean Penn (dir.), Emile Hirsch, Vince Vaughn
183 - Life of Brian (1979) - Starring: Terry Jones (dir.), Graham Chapman, John Cleese
184 - It Happened One Night (1934) - Starring: Frank Capra (dir.), Clark Gable, Claudette Colbert
185 - Andrei Rublev (1966) - Starring: Andrei Tarkovsky (dir.), Anatoliy Solonitsyn, Ivan Lapikov
186 - Jurassic Park (1993) - Starring: Steven Spielberg (dir.), Sam Neill, Laura Dern
187 - Platoon (1986) - Starring: Oliver Stone (dir.), Charlie Sheen, Tom Berenger
188 - In the Name of the Father (1993) - Starring: Jim Sheridan (dir.), Daniel Day-Lewis, Pete Postlethwaite
189 - Rang De Basanti (2006) - Starring: Rakeysh Omprakash Mehra (dir.), Aamir Khan, Soha Ali Khan
190 - Stand by Me (1986) - Starring: Rob Reiner (dir.), Wil Wheaton, River Phoenix
191 - The Grand Budapest Hotel (2014) - Starring: Wes Anderson (dir.), Ralph Fiennes, F. Murray Abraham
192 - Network (1976) - Starring: Sidney Lumet (dir.), Faye Dunaway, William Holden
193 - Hotel Rwanda (2004) - Starring: Terry George (dir.), Don Cheadle, Sophie Okonedo
194 - The Passion of Joan of Arc (1928) - Starring: Carl Theodor Dreyer (dir.), Maria Falconetti, Eugene Silvain
195 - Stalker (1979) - Starring: Andrei Tarkovsky (dir.), Alisa Freyndlikh, Aleksandr Kaydanovskiy
196 - Ben-Hur (1959) - Starring: William Wyler (dir.), Charlton Heston, Jack Hawkins
197 - The Truman Show (1998) - Starring: Peter Weir (dir.), Jim Carrey, Ed Harris
198 - The Wages of Fear (1953) - Starring: Henri-Georges Clouzot (dir.), Yves Montand, Charles Vanel
199 - Persona (1966) - Starring: Ingmar Bergman (dir.), Bibi Andersson, Liv Ullmann
200 - Rush (2013) - Starring: Ron Howard (dir.), Daniel Brühl, Chris Hemsworth
201 - Memories of Murder (2003) - Starring: Joon-ho Bong (dir.), Kang-ho Song, Sang-kyung Kim
202 - 12 Years a Slave (2013) - Starring: Steve McQueen (dir.), Chiwetel Ejiofor, Michael Kenneth Williams
203 - Million Dollar Baby (2004) - Starring: Clint Eastwood (dir.), Hilary Swank, Clint Eastwood
204 - Mad Max: Fury Road (2015) - Starring: George Miller (dir.), Tom Hardy, Charlize Theron
205 - The 400 Blows (1959) - Starring: François Truffaut (dir.), Jean-Pierre Léaud, Albert Rémy
206 - Spotlight (2015) - Starring: Tom McCarthy (dir.), Mark Ruffalo, Michael Keaton
207 - Logan (2017) - Starring: James Mangold (dir.), Hugh Jackman, Patrick Stewart
208 - Before Sunrise (1995) - Starring: Richard Linklater (dir.), Ethan Hawke, Julie Delpy
209 - Amores Perros (2000) - Starring: Alejandro G. Iñárritu (dir.), Emilio Echevarría, Gael García Bernal
210 - Hachi: A Dog's Tale (2009) - Starring: Lasse Hallström (dir.), Richard Gere, Joan Allen
211 - Prisoners (2013) - Starring: Denis Villeneuve (dir.), Hugh Jackman, Jake Gyllenhaal
212 - Butch Cassidy and the Sundance Kid (1969) - Starring: George Roy Hill (dir.), Paul Newman, Robert Redford
213 - The Princess Bride (1987) - Starring: Rob Reiner (dir.), Cary Elwes, Mandy Patinkin
214 - Blade Runner 2049 (2017) - Starring: Denis Villeneuve (dir.), Harrison Ford, Ryan Gosling
215 - Nausicaä of the Valley of the Wind (1984) - Starring: Hayao Miyazaki (dir.), Sumi Shimamoto, Mahito Tsujimura
216 - Catch Me If You Can (2002) - Starring: Steven Spielberg (dir.), Leonardo DiCaprio, Tom Hanks
217 - Harry Potter and the Deathly Hallows: Part 2 (2011) - Starring: David Yates (dir.), Daniel Radcliffe, Emma Watson
218 - Rocky (1976) - Starring: John G. Avildsen (dir.), Sylvester Stallone, Talia Shire
219 - The Maltese Falcon (1941) - Starring: John Huston (dir.), Humphrey Bogart, Mary Astor
220 - La La Land (2016) - Starring: Damien Chazelle (dir.), Ryan Gosling, Emma Stone
221 - The Grapes of Wrath (1940) - Starring: John Ford (dir.), Henry Fonda, Jane Darwell
222 - Barry Lyndon (1975) - Starring: Stanley Kubrick (dir.), Ryan O'Neal, Marisa Berenson
223 - Monsters, Inc (2001) - Starring: Pete Docter (dir.), Billy Crystal, John Goodman
224 - Donnie Darko (2001) - Starring: Richard Kelly (dir.), Jake Gyllenhaal, Jena Malone
225 - The Nights of Cabiria (1957) - Starring: Federico Fellini (dir.), Giulietta Masina, François Périer
226 - Diabolique (1955) - Starring: Henri-Georges Clouzot (dir.), Simone Signoret, Véra Clouzot
227 - A Wednesday (2008) - Starring: Neeraj Pandey (dir.), Anupam Kher, Naseeruddin Shah
228 - Gandhi (1982) - Starring: Richard Attenborough (dir.), Ben Kingsley, John Gielgud
229 - The Terminator (1984) - Starring: James Cameron (dir.), Arnold Schwarzenegger, Linda Hamilton
230 - Paper Moon (1973) - Starring: Peter Bogdanovich (dir.), Ryan O'Neal, Tatum O'Neal
231 - La Haine (1995) - Starring: Mathieu Kassovitz (dir.), Vincent Cassel, Hubert Koundé
232 - Groundhog Day (1993) - Starring: Harold Ramis (dir.), Bill Murray, Andie MacDowell
233 - The Wizard of Oz (1939) - Starring: Victor Fleming (dir.), Judy Garland, Frank Morgan
234 - Dead Poets Society (1989) - Starring: Peter Weir (dir.), Robin Williams, Robert Sean Leonard
235 - Touch of Evil (1958) - Starring: Orson Welles (dir.), Charlton Heston, Orson Welles
236 - Jaws (1975) - Starring: Steven Spielberg (dir.), Roy Scheider, Robert Shaw
237 - The Bourne Ultimatum (2007) - Starring: Paul Greengrass (dir.), Matt Damon, Edgar Ramírez
238 - The Help (2011) - Starring: Tate Taylor (dir.), Emma Stone, Viola Davis
239 - In the Mood for Love (2000) - Starring: Kar-Wai Wong (dir.), Tony Chiu-Wai Leung, Maggie Cheung
240 - 8½ (1963) - Starring: Federico Fellini (dir.), Marcello Mastroianni, Anouk Aimée
241 - Annie Hall (1977) - Starring: Woody Allen (dir.), Woody Allen, Diane Keaton
242 - Guardians of the Galaxy (2014) - Starring: James Gunn (dir.), Chris Pratt, Vin Diesel
243 - Before Sunset (2004) - Starring: Richard Linklater (dir.), Ethan Hawke, Julie Delpy
244 - Paris, Texas (1984) - Starring: Wim Wenders (dir.), Harry Dean Stanton, Nastassja Kinski
245 - Gangs of Wasseypur (2012) - Starring: Anurag Kashyap (dir.), Manoj Bajpayee, Richa Chadha
246 - The Best Years of Our Lives (1946) - Starring: William Wyler (dir.), Myrna Loy, Dana Andrews
247 - PK (2014) - Starring: Rajkumar Hirani (dir.), Aamir Khan, Anushka Sharma
248 - Pirates of the Caribbean: The Curse of the Black Pearl (2003) - Starring: Gore Verbinski (dir.), Johnny Depp, Geoffrey Rush
249 - Fanny and Alexander (1982) - Starring: Ingmar Bergman (dir.), Bertil Guve, Pernilla Allwin
250 - Tangerines (2013) - Starring: Zaza Urushadze (dir.), Lembit Ulfsak, Elmo Nüganen

Flowchart:

Python Web Scraping Flowchart: Download IMDB's Top 250 data.

Python Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a Python program to scrap number of tweets of a given Twitter account.
Next:Write a Python program to get movie name, year and a brief summary of the top 10 random movies.

What is the difficulty level of this exercise?