V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2019-05-03 12:36:10 +08:00 · 2625 次点击
    这是一个创建于 1791 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

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

    8 条回复    2019-05-11 21:57:22 +08:00
    BaiLinfeng
        1
    BaiLinfeng  
       2019-05-03 21:08:43 +08:00
    怎么使用的没看懂这个求具体使用教程
    Northxw
        2
    Northxw  
    OP
       2019-05-03 22:29:53 +08:00
    @BaiLinfeng clone 到本地,进入根目录,命令行先运行 common.py, 再运行 meituan.py 就可以了。前提是:先在 mysql 里建立表格。
    BaiLinfeng
        3
    BaiLinfeng  
       2019-05-03 23:32:32 +08:00 via iPhone
    @Northxw 哦好吧,这个还玩不了 6
    djgreat
        4
    djgreat  
       2019-05-07 09:43:52 +08:00
    已经 star 一会测试下,回馈
    Northxw
        5
    Northxw  
    OP
       2019-05-07 14:25:07 +08:00
    @djgreat 回馈???
    ealltor
        6
    ealltor  
       2019-05-10 01:36:47 +08:00 via Android
    美团的字体加密是不变的吗?
    Northxw
        7
    Northxw  
    OP
       2019-05-10 07:30:10 +08:00
    @ealltor 这里用的是接口数据,只需要搞定_token 参数即可。你说的是哪个页面?
    ealltor
        8
    ealltor  
       2019-05-11 21:57:22 +08:00 via Android
    @Northxw 忘了说,我指的是店铺的评论被加密了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2704 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 15:34 · PVG 23:34 · LAX 08:34 · JFK 11:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.