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

Error in getAllMessagesInChat "Cyclic object value" #1083

Open dafner opened 2 years ago

dafner commented 2 years ago

Hi everyone.

Recently I am having problems with some chats when trying to read the last messages of each one.

I am using the following code:

driver = WhatsAPIDriver(username = options["username"], profile = options["firefox_profile"])
driver.wait_for_login()

chat = driver.get_chat_from_name(contact_name)

chat.load_earlier_messages_till(datetime.now())

messages = chat.get_messages(True, True)

print("MSG", messages)
# process messages
for message in messages:
    #print(json.dumps(message.get_js_obj(), indent = 4))

and this is the error that occurs: Error in function getAllMessagesInChat (Cyclic object value). Command: return API.getAllMessagesInChat('54****@c.us',true,true, arguments[0])

I am using firefox and I have updated the web driver to the latest available (geckodriver-v0.30.0-linux64.tar.gz)

Python packages: Requirement already satisfied: selenium in /usr/local/lib/python3.9/dist-packages (3.141.0) Collecting selenium Using cached selenium-3.141.0-py2.py3-none-any.whl (904 kB) Using cached selenium-3.14.1-py2.py3-none-any.whl (902 kB) Requirement already satisfied: urllib3 in / usr / lib / python3 / dist-packages (from selenium) (1.26.2)

Has anyone had the same kind of error? Have you found a solution?

Thank you very much for any kind of help