Webwhatsapp-wrapper: stuck in Waiting for QR

Created on 21 Jun 2020  路  4Comments  路  Source: mukulhase/WebWhatsapp-Wrapper

I'm using the echo demo as it is. It opened the firefox windonws, I scan the QR and it is stuck in waiting for QR.

Code for reference:

import time
from webwhatsapi import WhatsAPIDriver
from webwhatsapi.objects.message import Message

driver = WhatsAPIDriver()
print("Waiting for QR")
driver.wait_for_login()

print("Bot started")

while True:
    time.sleep(3)
    print("Checking for more messages")
    for contact in driver.get_unread():
        for message in contact.messages:
            if isinstance(message, Message):  # Currently works for text messages only.
                contact.chat.send_message(message.content)

Most helpful comment

Same here. It appears Whatsapp Web has changed the layout of its page.
Try changing the selector of mainPage (line 78, __init__.py) to "#app .two"
If it works I will send a merge request

All 4 comments

Same here. It appears Whatsapp Web has changed the layout of its page.
Try changing the selector of mainPage (line 78, __init__.py) to "#app .two"
If it works I will send a merge request

Same here. It appears Whatsapp Web has changed the layout of its page.
Try changing the selector of mainPage (line 78, init.py) to "#app .two"
If it works I will send a merge request

Solution worked. But another problem appears:

Traceback (most recent call last):
File "sample/remote.py", line 30, in <module>
for contact in driver.get_unread():
File "/usr/local/lib/python3.8/site-packages/webwhatsapi/__init__.py", line 411, in get_unread
raw_message_groups = self.wapi_functions.getUnreadMessages(
File "/usr/local/lib/python3.8/site-packages/webwhatsapi/wapi_js_wrapper.py", line 44, in __getattr__
wapi_functions = dir(self)
File "/usr/local/lib/python3.8/site-packages/webwhatsapi/wapi_js_wrapper.py", line 72, in __dir__
self.driver.execute_script(script.read())
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 634, in execute_script
return self.execute(command, {
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: window.Store.Msg is undefined

Apply all changes from pull request #888.

After applying PR #888 changes I'm getting new errors:
untu@ip-xxxxx-xxx:~/whatsapp/WebWhatsapp-Wrapper$ python3.7
Python 3.7.8 (default, Jun 29 2020, 05:46:05)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

from webwhatsapi import WhatsAPIDriver
driver = WhatsAPIDriver(username="mkhase")
driver.get_status()
'LoggedIn'
driver.get_unread()

Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/__init__.py", line 411, in get_unread
raw_message_groups = self.wapi_functions.getUnreadMessages(
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/wapi_js_wrapper.py", line 44, in __getattr__
wapi_functions = dir(self)
File "/home/ubuntu/whatsapp/WebWhatsapp-Wrapper/webwhatsapi/wapi_js_wrapper.py", line 74, in __dir__
result = self.driver.execute_script("return window.WAPI")
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/ubuntu/.local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: Cyclic object value

Anyone else got this error? (In older threads the recommendation was to downgrade to firefox 61 which didn't work for me at all).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smileman03 picture smileman03  路  5Comments

erickythierry picture erickythierry  路  5Comments

kashif-raza picture kashif-raza  路  5Comments

EdisonHundLucas picture EdisonHundLucas  路  6Comments

desstannoz picture desstannoz  路  4Comments