Open andlb opened 1 year ago
In my case I just changed the querySelector, I did this in wapi_js_wrapper.py
so the script can be injected:
From:
result = self.driver.execute_script("if (document.querySelector('*[data-icon=chat]') !== null) { return true } else { return false }")
To:
result = self.driver.execute_script("if (document.querySelector('*[data-icon=default-user]') !== null || document.querySelector('*[data-icon=chat]') !== null ) { return true } else { return false }")
Thanks very much. I helped me a lot. I didn't know where to look. The final solution for me was that one:
result = self.driver.execute_script("if (document.querySelector('[data-icon=default-user]') !== null || document.querySelector('[data-icon=new-chat]') !== null || document.querySelector('*[data-icon=chat]') !== null ) { return true } else { return false }")
I added a new clause to data-icon=new-chat.
You may have to do that in the future too.
Does anybody is having problem with new whatsapp version?
I got this error:
---> 44 wapi_functions = dir(self) 45 46 if item not in wapi_functions:
TypeError: 'NoneType' object is not iterable
There isn't window.WAPI anymore.