mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.03k stars 797 forks source link

Whatsapp webapp pages have been changed. Selectors deprecated. #913

Open Sufl0wer opened 4 years ago

Sufl0wer commented 4 years ago

As in the title whatsapp managed to change webapp pages, so current selectors that bot uses is irrelevant.

I have seen one or two issues about this but they were about one particular case. The root of the problem is that old selectors in _SELECTORS don't work anymore. They should be fixed asap.

g4w4 commented 4 years ago

This works for me

_SELECTORS = { 'firstrun': "#wrapper", 'qrCode': "canvas[aria-label=\"Scan me!\"]", 'qrCodePlain': "div[data-ref]", 'mainPage': ".two", 'chatList': ".infinite-list-viewport", 'messageList': "#main > div > div:nth-child(1) > div > div.message-list", 'unreadMessageBar': "#main > div > div:nth-child(1) > div > div.message-list > div.msg-unread", 'searchBar': ".input", 'searchCancel': ".icon-search-morph", 'chats': ".infinite-list-item", 'chatBar': 'div.input', 'sendButton': 'button.icon:nth-child(3)', 'LoadHistory': '.btn-more', 'UnreadBadge': '.icon-meta', 'UnreadChatBanner': '.message-list', 'ReconnectLink': '.action', 'WhatsappQrIcon': 'span.icon:nth-child(2)', 'QRReloader': 'div[data-ref] > span > div' }