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.04k stars 794 forks source link

driver.get_unread() throwing exception #365

Open jdcano1984 opened 6 years ago

jdcano1984 commented 6 years ago

The driver.get_unread() method is throwing the following exception:

Traceback (most recent call last): File "/home/comida/whatsapp_script/prueba_location.py", line 14, in <module> for contact in driver.get_unread(): File "/usr/local/lib/python3.5/dist-packages/webwhatsapi/__init__.py", line 327, in get_unread raw_message_groups = self.wapi_functions.getUnreadMessages(include_me, include_notifications, use_unread_count) File "/usr/local/lib/python3.5/dist-packages/webwhatsapi/wapi_js_wrapper.py", line 28, in __getattr__ wapi_functions = dir(self) File "/usr/local/lib/python3.5/dist-packages/webwhatsapi/wapi_js_wrapper.py", line 46, in __dir__ self.driver.execute_script(script.read()) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 629, in execute_script 'args': converted_args})['value'] File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 314, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: TypeError: document.querySelector(...)._reactRootContainer.current is undefined

Could someone help me with this??

soaresdude commented 6 years ago

I have the same problem. I've read somewhere they fixed this with the react actions or something like that, but it wasn't on this repository.

bobaoapae commented 6 years ago

replace WAPI.js to WAPI.js from this github

jdcano1984 commented 6 years ago

This worked!!! Thanks!!!

On Sat, Aug 11, 2018, 3:18 PM João Vitor Borges notifications@github.com wrote:

replace WAPI.js to WAPI.js from this github

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/365#issuecomment-412299157, or mute the thread https://github.com/notifications/unsubscribe-auth/AoUbzPjanrgzOGkjW_8vlwPAVpkckIBTks5uPzwUgaJpZM4V4ede .

DanielUnn commented 6 years ago

@bobaoapae Hi there, just replaced the wapi.js will solve it?

File "C:\Users\Dl\Anaconda3\envs\tensorflow\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)

JavascriptException: TypeError: document.querySelector(...)._reactRootContainer.current is undefined

I got this error when I scanned the code. Please help. Thanks

bobaoapae commented 6 years ago

yes @DanielUnn

DanielUnn commented 6 years ago

@bobaoapae I did it but I still getting the same error.

bobaoapae commented 6 years ago

No possible... Using this ? -> https://github.com/mukulhase/WebWhatsapp-Wrapper/blob/master/webwhatsapi/js/wapi.js

DanielUnn commented 6 years ago

@bobaoapae yeah,but I still getting it when I run echo.py script.

bobaoapae commented 6 years ago

new WAPI.js don't even contains this words document.querySelector(...)._reactRootContainer.current I think you forgot something...

DanielUnn commented 6 years ago

@bobaoapae weird as I just replaced it again and run the echo.py. Is there anything else I left out?

DanielUnn commented 6 years ago

@bobaoapae Can I also ask you, for those scripts which contain SELENIUM, how do I set up for it? Please guide me. Thanks

mvenezia00 commented 6 years ago

I've resolved by rebuilding the python/webwhatsapi docker base image

DanielUnn commented 6 years ago

@mvenezia00 Can you guide me on that? Thanks

nahs commented 5 years ago

replace WAPI.js to WAPI.js from this github

Hey. I replaced wapi.js. But now the error selenium.common.exceptions.JavascriptException: Message: Cyclic object value is displayed. what can be done about it?

lfdelphino commented 5 years ago

@nahs That's due to your Firefox version, check #404

nsperic commented 5 years ago

I am using firefox 61.0.2 and python 3.6. Change de file WAPI.js and the error remains...

selenium.common.exceptions.JavascriptException: Message: TypeError: document.querySelector(...)._reactRootContainer.current is undefined