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.02k stars 796 forks source link

Doesn't work with WhatsApp's latest version #1139

Open hellmrf opened 2 years ago

hellmrf commented 2 years ago

The package isn't working anymore with the latest WhatsApp version. I had Multi-Devices Beta activated, but the same happens after disabling it.

First, driver.is_logged_in() always returns False. And, after login, I use the following code and get the following log.

from webwhatsapi import WhatsAPIDriver
driver = WhatsAPIDriver(username="API")
chat = driver.get_chat_from_phone_number(SOME_PHONE_NUMBER, True)
chat.send_message("Hello World!")

Log:

Traceback (most recent call last):
  File "/home/helitonmrf/Projects/WhatsAppBulkSender/src/__init__.py", line 38, in <module>
    main()
  File "/home/helitonmrf/Projects/WhatsAppBulkSender/src/__init__.py", line 30, in main
    chat = driver.get_chat_from_phone_number("5531989429782", True)
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/webwhatsapi/__init__.py", line 458, in get_chat_from_phone_number
    for chat in self.get_all_chats():
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/webwhatsapi/__init__.py", line 304, in get_all_chats
    return [factory_chat(chat, self) for chat in self.wapi_functions.getAllChats()]
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/webwhatsapi/wapi_js_wrapper.py", line 28, in __getattr__
    wapi_functions = dir(self)
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/webwhatsapi/wapi_js_wrapper.py", line 46, in __dir__
    self.driver.execute_script(script.read())
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 879, in execute_script
    return self.execute(command, {
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 425, in execute
    self.error_handler.check_response(response)
  File "/home/helitonmrf/miniconda3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: document.querySelector(...)._reactRootContainer.current is undefined
Stacktrace:
@https://web.whatsapp.com/:91:33
@https://web.whatsapp.com/:957:8

Probably related to #1137.

Elintondm commented 2 years ago

Any news?

hellmrf commented 2 years ago

@Elintondm nope. Also, this project seems to be unmaintained, so I just switched to Node.js and began using whatsapp-web.js.

yoking1341 commented 2 years ago

@hellmrf is that workable? I mean whatsapp-web.js