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() doesn't work #748

Open belqit opened 4 years ago

belqit commented 4 years ago

I'm using default echo.py with docker setup

this is the output when I receive a message:

Traceback (most recent call last):
  File "sample/echo.py", line 19, in <module>
    for contact in driver.get_unread():
  File "/usr/local/lib/python2.7/site-packages/webwhatsapi/__init__.py", line 368, in get_unread
    messages = list(filter(None.__ne__,[factory_message(message, self) for message in raw_message_group['messages']]))
AttributeError: 'NoneType' object has no attribute '__ne__'
syberi commented 4 years ago

browser ver? it's work correctly with firefox 61.0, new versions isnt work.

belqit commented 4 years ago

image

I've used: docker run -d -p 4444:4444 -p 5900:5900 --name firefox --network selenium -v /dev/shm:/dev/shm selenium/standalone-firefox-debug:3.14.0-curium

erickythierry commented 4 years ago

You don't have to use the docker if you don't want to. I particularly preferred to remove the docker from my project and run the python script on the system directly.

belqit commented 4 years ago

I would need docker because I'm running it on headless linux

erickythierry commented 4 years ago

I would need docker because I'm running it on headless linux

I also use a vps linux to run my code, but I installed a graphical interface on my vps which helps me a lot to configure and start the bot. I gave up the docker because it was one more item I would need to configure every time I rebuild the runtime environment.

gushome7 commented 4 years ago

Have same problem. @belqit did you find a solution?

belqit commented 4 years ago

Have same problem. @belqit did you find a solution?

negative. I'm using new_messages_observer.py, it works but it can't read unread messages if python crash

gushome7 commented 4 years ago

I see... I tried downgrading selenium/firefox and geckodriver with no result. @erickythierry have you some tips to run standalone? (versions, dependences, sample code calling driver?) sorry for that and thanks!

erickythierry commented 4 years ago

I see... I tried downgrading selenium/firefox and geckodriver with no result. @erickythierry have you some tips to run standalone? (versions, dependences, sample code calling driver?) sorry for that and thanks!

I could only get my code to work using firefox version 61, and geckodriver version 0.21.0. I was also only able to work on linux ubuntu (from 16.04) using python3 (python2 gave a lot of problems). I used the echo example to build my code.

erickythierry commented 4 years ago

Capturar

gushome7 commented 4 years ago

Thanks!

Capturar

Thanks!

erickythierry commented 4 years ago

in the ubuntu terminal i install the python3 and the pip3. then i clone this repository and run the comand pip3 install -r requirements.txt

then I download and manually install firefox and geckodriver on the specific versions I sent before.

After these steps I can run this code that I sent in the image without problems (using python3)

gushome7 commented 4 years ago

I'm frustrated... Thanks to your recommendations @erickythierry, I'm installed all requirements, and run echo code modified. get_unread don't crash but return nothing. Also, If I try to send a message nothing happens..

Code: driver.chat_send_seen('5491158793853@c.us') (work) driver.send_message_to_id('5491158793853@c.us','skyrocketing...') (don't)