Open josep112 opened 3 years ago
Download the module source and install from that. For some reason it happens to me with the module installed with pip. You can even simply download and use it without install.
sys.path.append('WebWhatsapp-Wrapper-master')
from webwhatsapi import WhatsAPIDriver
use this command to install the latest version: pip install --upgrade git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
@marcelocecin
I gave the command but I get this error
root@docker-lab:/usr/src# pip install --upgrade git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
Collecting git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
Cloning https://github.com/mukulhase/WebWhatsapp-Wrapper.git to /tmp/pip-qLAz39-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-qLAz39-build/
if you are installing for the first time type: pip install git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
root@docker-lab:/usr/src# pip install git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
Collecting git+https://github.com/mukulhase/WebWhatsapp-Wrapper.git
Cloning https://github.com/mukulhase/WebWhatsapp-Wrapper.git to /tmp/pip-S901Xu-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-S901Xu-build/
what is the version of python and pip?
root@docker-lab:~# pip --version pip 20.2.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7) root@docker-lab:~# root@docker-lab:~# python --version Python 2.7.13
try to use python 3
now the error has changed after giving the command and doing the qrcode it appears these errors
docker run --network selenium -it -e SELENIUM='http://firefox:4444/wd/hub' -v $(pwd):/app webwhatsapi /bin/bash -c "pip install ./;pip list;python sample/remote.py"
Waiting for QR Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/webwhatsapi/init.py", line 322, in wait_for_login self.driver.find_element_by_css_selector(self._SELECTORS['mainPage']) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 598, in find_element_by_css_selector return self.find_element(by=By.CSS_SELECTOR, value=css_selector) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element return self.execute(Command.FIND_ELEMENT, { File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: .two
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sample/remote.py", line 27, in
try looking for other issues about this docker error
now the error has changed after giving the command and doing the qrcode it appears these errors
docker run --network selenium -it -e SELENIUM='http://firefox:4444/wd/hub' -v $(pwd):/app webwhatsapi /bin/bash -c "pip install ./;pip list;python sample/remote.py"
Waiting for QR Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/webwhatsapi/init.py", line 322, in wait_for_login self.driver.find_element_by_css_selector(self._SELECTORS['mainPage']) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 598, in find_element_by_css_selector return self.find_element(by=By.CSS_SELECTOR, value=css_selector) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element return self.execute(Command.FIND_ELEMENT, { File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: .two
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "sample/remote.py", line 27, in driver.wait_for_login() File "/usr/local/lib/python3.8/site-packages/webwhatsapi/init.py", line 325, in wait_for_login self.driver.find_element_by_css_selector(self._SELECTORS['qrCode']) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 598, in find_element_by_css_selector return self.find_element(by=By.CSS_SELECTOR, value=css_selector) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element return self.execute(Command.FIND_ELEMENT, { File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: canvas
I fixed the same issue changing the selector in webwhatsapi/init.py Before "mainPage": ".two" After "mainPage": "div._36Q2N.two"
div._36Q2N.two
Thanks for the tip! I was finally able to log in thanks to you.
Do you have any other selector changes?
I tried to run driver.get_unread()
and got TypeError: document.querySelector(...)._reactRootContainer.current is undefined
I have got the same error: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: canvas, but change "mainPage" selectors from ".two" to "div._36Q2N.two" don't solve the problem.
I search for the correct selector and see that to be right, however, the error happen yet!
Environment {'LANG': 'C.UTF-8', 'PYTHONIOENCODING': 'UTF-8', 'TERM': 'xterm', 'GPG_KEY': 'C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF', 'PYTHON_VERSION': '2.7.18', 'PYTHON_GET_PIP_URL': 'https://github.com/pypa/get-pip/raw/d59197a3c169cef378a22428a3fa99d33e080a5d/get-pip.py', 'SHLVL': '1', 'PYTHON_PIP_VERSION': '20.0.2', 'HOSTNAME': '6704e2f0c69c', 'SELENIUM': 'http://firefox:4444/wd/hub', 'PYTHON_GET_PIPSHA256': '421ac1d44c0cf9730a088e337867d974b91bdce4ea2636099275071878cc189e', 'PWD': '/app', 'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOME': '/root', '': '/usr/local/bin/python'} Waiting for QR
I downloaded the master files and did the installation by docker and I'm using the samples/remote.py file but after qrcode by vnc nothing happens in the terminal, there are more updated files how should I proceed? Any help is welcome , thanks