italoseara / whatsappy

A whatsapp api made with selenium in Python
MIT License
43 stars 8 forks source link

getting an error tryna run the newmessage.py example #7

Closed 13100D closed 2 years ago

13100D commented 2 years ago

[08:28:23] Successfully logged in login.py:127 Traceback (most recent call last): File "c:\python scripts\whtest.py", line 8, in if whatsapp.new_message(): # <-- File "c:\Users[user]\AppData\Local\Programs\Python\Python38\lib\site-packages\whatsappy\chat.py", line 104, in new_message message = self.last_message() File "c:\Users[user]\AppData\Local\Programs\Python\Python38\lib\site-packages\whatsappy\chat.py", line 19, in last_message type = self.driver.execute_script(""" File "c:\Users[user]\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 634, in execute_script return self.execute(command, { File "c:\Users[user]\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "c:\Users[user]\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of undefined (reading 'querySelector') (Session info: chrome=96.0.4664.45)

italoseara commented 2 years ago

maybe the selectors were changed when whatsapp updated (that's why it is reading 'undefined'), i'll try to remake most of the functions to prevent this kind of problems