imdbwebscraper

An imdb search API that retreives the title , rank and year of necessary keywords.


Keywords
conversion
License
MIT
Install
pip install imdbwebscraper==0.0.5

Documentation

About

IMDb-WebScraper is a simple scraper that helps Data Scientists to collect IMDb data for personal projects. The scraper utilizes Selenium and IMDbPy.

The IMDb-WebScraper is designed for small amount of data and does not intend to violate IMDb's Terms of Services, as precribed here

Setup

Install package:

pip install imdbwebscraper

The package utilizes Selenium's WebDriver. Although the package comes with Selenium, you will need to your WebDriver to PATH, read here for further information.

# To import the package
from imdbwebscraper import Scraper

To utilize the package, first go on IMDb's Advanced Title Search and query your desired result. Your result should be something like this. Copy the URL of the result page.

# Supported Browser: ["chrome", "firefox", "edge", "safari"]
browser = 'chrome`
url = 'https://www.imdb.com/search/title/?title=The+Worst+Year+of+My+Life'

# Create Scraper instance
result = Scraper(browser=browser, url=url)
movie_list = result.get_movies()

# View keys of the first movie
movie_list[0].keys()

# Returns cast of the first movie
movie_list[0]['cast']

movie_list would be a list of dictionary-like objects created by IMDbPy. Read their doc for details on how to interact with the object. The scraper is designed to query one movie every 5 seconds to respect IMDB's Terms of Service.

Future Development

You are welcome to read the source codes on GitHub, but it includes codes and epxloration that I am still working on.

Although currently at capacity, the next phase is to develop modules to output a CSV or JSON. Stay tuned!

License

MIT License

Copyright (c) 2021 Chia Yu

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.