Coder Social home page Coder Social logo

meituan-movie-price-crawler's Introduction

美团电影爬虫/美团电影价格图片混淆破解


项目难点:


让我们先来随便打开一个美团电影的页面

此处输入图片的描述

真是美滋滋啊,这个价格就写在上面!爬下来不就得了。

定睛一看代码,我了个擦,这是个什么东西。

此处输入图片的描述

打开图片URL,才明白过来,原来是一张大图一堆数字,用CSS定位的具体数字,美团你为了反爬真是煞费苦心啊……

此处输入图片的描述


Cracked


requirement:

bs4 requests Pillow/PIL

需要独立安装tesseract-ocr

使用方法:

  1. 安装tesseract-ocr
  2. 将num.traineddata复制粘贴到tesseract的tessdata目录中
  3. 修改meituan_price_img.py中的TESSERACT_PATH变量定位到tesseract.exe (绝对路径)
  4. 打开meituan.py,Enjoy it!

Example:

print get_city_url('上海') #获取城市的地址
print get_all_cinema('sh.meituan.com') #获取城市所有电影院信息
print get_cinema_movie('http://sh.meituan.com/shop/58174') #获取指定电影院所有电影场次信息

原理:

你都看到tesseract-ocr了原理还用我废话嘛?机器学习了所有数字的样本(精准到1px),然后自动识别并输出咯。 PS:如果价格有手机专享价,会自动输出手机专享价!

meituan-movie-price-crawler's People

Contributors

hiddenstrawberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.