Code Monkey home page Code Monkey logo

imdb_toplist's Introduction

IMDB Toplist Scrapy Project

A Python spider built on Scrapy. It scrapes and stores a list of top movies.

Installation

Install Python, Python headers and static libs (required to install PIL), Scrapy, PIL and PyMySQL.

Create a database:

CREATE DATABASE `imdb_toplist` CHARSET utf8 COLLATE utf8_general_ci;

USE `imdb_toplist`;

CREATE TABLE `movie` (
  `id` int(11) unsigned NOT NULL,
  `url` varchar(255) DEFAULT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `original_title` varchar(255) DEFAULT NULL,
  `description` varchar(511) DEFAULT NULL,
  `year` smallint(4) NOT NULL,
  `length` smallint(5) unsigned NOT NULL DEFAULT '0',
  `director` varchar(128) DEFAULT NULL,
  `image_small` varchar(255) DEFAULT NULL,
  `image_large` varchar(255) DEFAULT NULL,
  `rating` decimal(2,2) unsigned NOT NULL DEFAULT '0.00',
  `votes` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `title_idx` (`title`),
  KEY `year_idx` (`year`),
  KEY `rating_idx` (`rating`),
  KEY `votes_idx` (`votes`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE USER 'imdb'@'localhost' IDENTIFIED BY 'imdb123';
GRANT ALL PRIVILEGES ON `imdb_toplist`.* TO 'imdb'@'localhost';
FLUSH PRIVILEGES

Clone the project:

git clone git://github.com/bkuberek/imdb_toplist.git

Run it:

cd imdb_toplist
scrapy crawl imdb_toplist

imdb_toplist's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

imdb_toplist's Issues

database error

When trying to use your scraper, i stumbled upon this problem:

pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (10061)")

I use Win7 and Python 2.7.

Do you know how to fix it??

Thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.