Skip to content

python program that scraps imdb.com and stores data into mysql db

Notifications You must be signed in to change notification settings

avraampiperidis/imdb_pyscraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imdb_pyscraper


python program that scraps imdb.com and stores data into mysql db

Intro-Info

All the movies/series in imdb.com are accessible from url
http://www.imdb.com/title/tt[movie id]/
witch starts from 0000001 and ends 9999999(!some of them are invalid,not taken yet)
also a relationship between higher id and year of movie/series exists!

And all the actors are accessible from url: http://www.imdb.com/name/nm[actor id]/

by incrementing movie id we get all movies,
and from movies we get the actors, from every movie casts.

Tv shows and series are also as movies.
show it goes like this series->seasons->episodes.

plot,actors bio,photo urls,genres,episodes titles are included in the scraping proccess.

Mysql Db Setup

Edit the conf.py for user mysql credentials.(be sure to have database creation privileges)
Run init_create_db_schema.py OR init_create_db_schema_with_indexes_references.py.
It will create the database and all its tables needed.
The difference between this two is tha the init_create_db_schema_with_indexes_references.py,
will create also indexes,references,keys,constraints,
while the other create_db_schema.py will create only the databas+tables.
Note for(init_create_db_schema_with_indexes_references.py) a lot amount of data the
database will become slow for updates/new inserts ,and will geting slower as the program runs,
and the data are geting even more.

the mysql workbench schema -> https://github.com/avraampiperidis/imdb_pyscraper/blob/master/workbench_schema.mwb?raw=true

Run

just run imdbmain.py


Configuration ----- conf.py contains some user options.
mysql connection credentials.
imdb scrap options.

*The script is a proof of concept. It’s mostly working, but you shouldn’t use it. IMDb doesn’t allow this method of data fetching.

The technique used is called “web scraping”. This means, if IMDb changes anything within their HTML source, the script is most likely going to fail. I won’t update this regularly, so don’t count on it to be working all the time.

License

MIT License

Copyright (c) 2016 Avraam Piperidis

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

python program that scraps imdb.com and stores data into mysql db

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages