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 793 forks source link

Store.Conn.me is undefined again #543

Open gabrieligbastos opened 5 years ago

gabrieligbastos commented 5 years ago

I've already saw #495 and #503 but not working, was not my problem =(

import os, sys, time, json, datetime, base64
import requests
from webwhatsapi import WhatsAPIDriver
from webwhatsapi.objects.message import Message

print "Environment", os.environ

try:
   os.environ["SELENIUM"]
except KeyError:
   print "Please set the environment variable SELENIUM to Selenium URL"
   sys.exit(1)

##Save session on "/firefox_cache/localStorage.json".
##Create the directory "/firefox_cache", it's on .gitignore
##The "app" directory is internal to docker, it corresponds to the root of the project.
##The profile parameter requires a directory not a file.

profiledir=os.path.join(".","firefox_cache")
if not os.path.exists(profiledir): os.makedirs(profiledir)

driver = WhatsAPIDriver(profile=profiledir, client='remote', command_executor=os.environ["SELENIUM"])
print("Waiting for QR")
driver.wait_for_login()

print("Saving session")
driver.save_firefox_profile(remove_old=False)

print 'Saved session'
botId = None

while botId is None:
    try:
    botId = driver.driver.execute_script("return Store.Conn.me.toString()")
    print("Bot started ", botId)
    except:
        print 'did not find connection.me, will try again'
    time.sleep(2)

warned = False

The program, thow exception, did not find connection.me If i run Store.Conn.me in Web Debug Console, I get Store.Conn in undefined.

If i run WAPI.getMe, also same error

Operating System Amazon Linux AMI release 2018.03 Linux ip-172-31-37-55 4.14.77-70.59.amzn1.x86_64 #1 SMP Mon Nov 12 22:02:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Python Version Python 2.7.15

Selenium Version Firefox v61.0.2 (64-bit)

Everything working inside docker container. Already tried to pull again all code from github and still now working =(

gabrieligbastos commented 5 years ago

Worked, actually I did not pull, the new version and built it

gabrieligbastos commented 5 years ago

Actually, it is intermitent, event after pull and rebuild, it start to not appear again =(

eransc commented 4 years ago

Store is not defined error is back since one week now. before that it was working just great . I'm working on Firefox v61.0.2 (64-bit)

anyone experienced this issue as well recently ?