V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
blue7wings
V2EX  ›  PHP

我想模拟微信网页版的扫一扫登陆,有什么比较好的方法?

  •  
  •   blue7wings · Dec 2, 2014 · 10647 views
    This topic created in 4164 days ago, the information mentioned may be changed or developed.

    小白一个,我想模拟微信网页版的登陆,登陆进去后抓取所有的联系人。用二维码扫描的方式登陆如何模拟呢?我想是不是抓取到二维码,让手机扫下,保存cookie然后跳转过去?求大神指导。。

    17 replies    2016-06-25 14:51:29 +08:00
    blue7wings
        1
    blue7wings  
    OP
       Dec 2, 2014
    为啥第一步,我抓取登陆页面总是给我跳转?代码如下:
    <?php

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,"https://login.weixin.qq.com/");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,0);
    curl_setopt($ch,CURLOPT_HEADER,1);
    // curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    $res = curl_exec($ch);
    curl_close($ch);

    总是一闪下,然后给我的地址加上https...
    zonyitoo
        2
    zonyitoo  
       Dec 2, 2014   ❤️ 1
    这是我做的。
    我可以明确地告诉你,不可以。
    lsylsy2
        3
    lsylsy2  
       Dec 2, 2014
    @zonyitoo 2L终结此帖……
    puras
        4
    puras  
       Dec 2, 2014
    嘿,有点意思~~~
    mcfog
        5
    mcfog  
       Dec 2, 2014   ❤️ 1
    别泄气,2L能防住你模拟登录,但防不住你直接操作浏览器拉数据

    扫码登录后

    WebMM.model('contact').getAllFriendContact()

    我就只帮到这里了
    blue7wings
        6
    blue7wings  
    OP
       Dec 2, 2014
    @mcfog 恩。明白了,O(∩_∩)O谢谢
    blue7wings
        7
    blue7wings  
    OP
       Dec 2, 2014
    @zonyitoo 微信猎手软件可以做到的,我想是不是这个原理。。。
    yunshansimon
        8
    yunshansimon  
       Dec 2, 2014
    接楼上,getAllContacts(), getAllChatroomContact(),getAllBrandContact()不需要参数,楼上的方法好像需要4个参数。
    zer
        9
    zer  
       Dec 2, 2014
    各种打脸,会很快就修复吧
    RagnarokStack
        10
    RagnarokStack  
       Dec 2, 2014
    我可以证明这是2楼做的。。而且压根绕不过登录那一步。。
    pljhonglu
        11
    pljhonglu  
       Dec 2, 2014
    2L 来了,估计没戏了。。。
    SquirrelMAN
        12
    SquirrelMAN  
       Dec 2, 2014
    2L。。
    sun019
        13
    sun019  
       Dec 2, 2014 via Android
    微信 带参数的二维码 参考例子v2ex 右边广告位
    wadezhao
        14
    wadezhao  
       Dec 2, 2014
    我读书少,语文是化学老师教的,刚开始没看懂,以为楼主要在自己的应用里模拟微信“式”的扫码登录,还奇怪,2楼就算微信是你做的,你能做别人为啥就不能做呢,后来看回复才明白,原来楼主是要登录到微信~~~
    icanfork
        15
    icanfork  
       Dec 2, 2014
    2L ....
    blue7wings
        16
    blue7wings  
    OP
       Dec 3, 2014
    @mcfog 再问一下,如何将这些数据进行保存?
    wenfan
        17
    wenfan  
       Jun 25, 2016
    为什么不可以啊?可以啊。 2L 都没有自己测试。我测试过了,可以抓取官方 qrcode 给用户扫描,然后后台 curl 模拟登录就可以了。。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3230 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 13:58 · PVG 21:58 · LAX 06:58 · JFK 09:58
    ♥ Do have faith in what you're doing.