【问题标题】:Is there any way to get online status from whatsapp into another android app有没有办法从whatsapp获取在线状态到另一个android应用程序
【发布时间】:2015-01-17 09:51:35
【问题描述】:

请说明是否有任何方法可以将特定联系人的在线状态从我的 whatsapp 获取到另一个 android 应用程序中。 谢谢

【问题讨论】:

  • WhatsDog 应用程序也在做同样的事情......怎么样??

标签: android social-networking


【解决方案1】:

除非 WhatsApp 愿意公开其返回请求联系人在线状态的 API。

【讨论】:

  • WhatsDog 应用程序也在做同样的事情......怎么样??
【解决方案2】:

是的,我已经做到了,我使用了 Selinium webdriver,它打开了我们正在跟踪的人的 web.whatsapp 页面***driver.get("https://web.whatsapp.com/send/?phone=91xxxxxxxx&text&app_absent=0&lang=en")***,它可以抓取该人的在线状态我们可以一遍又一遍地循环这个过程,当状态从 online 变为 null 或相反时,我们可以通知我们的应用程序或电报机器人,


while True:
    time.sleep(2)
    try:
        a = driver.find_element_by_xpath('/html/body/div/div[1]/div[1]/div[4]/div[1]/header/div[2]/div[2]/span').text
        if c!=a and a!="click here for contact info":
            now = datetime.datetime.now()
            print(a+' @ '+ now.strftime("%H:%M:%S"))
            c='online'
    except Exception:
        if c != 'offline':
            now = datetime.datetime.now()
            print("offline"+' @ '+ now.strftime("%H:%M:%S"))
            c = 'offline'

但这个过程有很多限制,不适合同时跟踪多个帐户。

【讨论】:

    猜你喜欢
    • 2011-09-26
    • 1970-01-01
    • 1970-01-01
    • 2021-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    • 1970-01-01
    相关资源
    最近更新 更多