Code Monkey home page Code Monkey logo

maoyan_scraper's Introduction

maoyan_scraper

Selenium based scraper that scrapes the top 100 movies on Maoyan.

This scraper will first go through the top 100 rankings to obtain the links to the detail page of each movie, then visit them one by one to obtain further information. In the event that the scraper is challenged with a captcha, it will wait for the captcha to be manually solved, then resumes the scraping process.

The following information will be scraped:

  1. rank - rank of the movie

  2. title - name of the movie

  3. link - link to the movie's detail page, note that the "https://www.maoyan.com" is omitted

  4. stars - main cast of the movie

  5. rating - rating of the movie

  6. director - director of the movie

  7. types - categories of the movie

  8. country/region - country/region where the movie is produced

  9. length - length of the movie

  10. release time - release time of the movie

  11. release place - release place of the movie

  12. box office (10k CNY) - box office of the movie, in 10K CNY

Usage

Clone this repository, then simply follow this notebook.

Maoyan number recognition

This scraper supports recognition of the anti-scraping-protected numeric fields on Maoyan.

Certain numeric fields in the movie detail pages are protected in the following way:

  1. Pick some unused unicode encodings
  2. Generate a font file with the glyph of 0-9, encode with the picked unicode encodings

As the result, these fields, albeit recognizable by human eyes, are actually garbled unicode, you may also notice that the font is slightly distorted:

anti-scraping font example

For more details, refer to the notebook. This implementation is inspired by MaoYanFontRecognize by aruiplex.

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.