V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Northxw
V2EX  ›  Python

抓取某团网美食店铺信息

  •  
  •   Northxw · May 3, 2019 · 3613 views
    This topic created in 2555 days ago, the information mentioned may be changed or developed.

      某团网的美食店铺信息主要通过接口获取,而接口最重要的参数就是 _token,其主要是通过对接口相应参数的二进制加密和 Base64 编码处理后得到,做一次 base64 解码、二进制解压即可清楚其中的加密原理( sign 参数相同)。所以,只需要伪装_token 参数,携带请求接口就可以拿到数据。

      另外,为提高爬取效率,实现了多进程,裸 IP 多进程访问会返回验证页,测试可用真机 IP。

      项目已提交 github, 欢迎提交 issue,pull requests 等。地址: https://github.com/Northxw/Meituan

    PS:断断续续写了好几天,比较佛系,如有冗余之处或不足之处还请见谅。

    8 replies    2019-05-11 21:57:22 +08:00
    BaiLinfeng
        1
    BaiLinfeng  
       May 3, 2019
    怎么使用的没看懂这个求具体使用教程
    Northxw
        2
    Northxw  
    OP
       May 3, 2019
    @BaiLinfeng clone 到本地,进入根目录,命令行先运行 common.py, 再运行 meituan.py 就可以了。前提是:先在 mysql 里建立表格。
    BaiLinfeng
        3
    BaiLinfeng  
       May 3, 2019 via iPhone
    @Northxw 哦好吧,这个还玩不了 6
    djgreat
        4
    djgreat  
       May 7, 2019
    已经 star 一会测试下,回馈
    Northxw
        5
    Northxw  
    OP
       May 7, 2019
    @djgreat 回馈???
    ealltor
        6
    ealltor  
       May 10, 2019 via Android
    美团的字体加密是不变的吗?
    Northxw
        7
    Northxw  
    OP
       May 10, 2019
    @ealltor 这里用的是接口数据,只需要搞定_token 参数即可。你说的是哪个页面?
    ealltor
        8
    ealltor  
       May 11, 2019 via Android
    @Northxw 忘了说,我指的是店铺的评论被加密了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2442 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 05:10 · PVG 13:10 · LAX 22:10 · JFK 01:10
    ♥ Do have faith in what you're doing.