Skip to content

Instantly share code, notes, and snippets.

@doroudi
Last active October 17, 2019 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doroudi/e0eb9809d48986183692bc7c855cdf49 to your computer and use it in GitHub Desktop.
Save doroudi/e0eb9809d48986183692bc7c855cdf49 to your computer and use it in GitHub Desktop.
Get movies title from imdb.com top movies
# -*- coding: utf-8 -*-
import scrapy
class TopmoviesSpider(scrapy.Spider):
name = 'topMovies'
allowed_domains = ['imdb.com']
start_urls = ['https://www.imdb.com/chart/top/']
def parse(self, response):
titles = response.css(".lister-list .titleColumn a::text").extract()
for title in titles:
print(title)
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment