VISWESWARAN1998 / Simple-Yet-Hackable-WhatsApp-api

There is no official WhatsApp API. Here is a simple python class which satisfies the need.
Apache License 2.0
611 stars 153 forks source link

problem #22

Closed nadif15 closed 5 years ago

nadif15 commented 5 years ago

Traceback (most recent call last): File "test.py", line 1, in from whatsapp import WhatsApp File "/root/Downloads/Simple-Yet-Hackable-WhatsApp-api-master/whatsapp.py", line 36, in class WhatsApp: File "/root/Downloads/Simple-Yet-Hackable-WhatsApp-api-master/whatsapp.py", line 41, in WhatsApp browser = webdriver.Chrome() # we are using chrome as our webbrowser File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=72.0.3626.53,platform=Linux 4.19.0-kali3-amd64 x86_64)

VISWESWARAN1998 commented 5 years ago

Are you sure the chrome is in correct path? Please make sure that Google chrome has been installed in correct path.

Create a new test python file and try running this code:

from selenium import webdriver

browser = webdriver.Chrome()
browser.get("https://www.google.com")

If the above code runs without any errors, please do contact me. It seems more like a problem in selenium and chrome configuration rather than this API.

Thank you! Visweswaran N

nadif15 commented 5 years ago

still error

browser = webdriver.Chrome() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=72.0.3626.53,platform=Linux 4.19.0-kali3-amd64 x86_64)

nadif15 commented 5 years ago

ok is fixed another problem appear

Traceback (most recent call last): File "test.py", line 2, in whatsapp = WhatsApp(10) File "/home/testonly/Downloads/Simple-Yet-Hackable-WhatsApp-api-master/whatsapp.py", line 51, in init (By.CSS_SELECTOR, '.jN-F5'))) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/support/wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:

nadif15 commented 5 years ago

ok is time limit but, is still not work just buff in chrome

VISWESWARAN1998 commented 5 years ago

Can you paste the code which throws the error here. Thank you!

nadif15 commented 5 years ago

no code just in web buff non stop

nadif15 commented 5 years ago

site cant be reach

VISWESWARAN1998 commented 5 years ago

You should have used my API code right? send the code!

nadif15 commented 5 years ago

from whatsapp import WhatsApp whatsapp = WhatsApp(100) print(whatsapp.send_message("Mori","thx!"))

VISWESWARAN1998 commented 5 years ago

I think everything works. This is just an automation script. QR code needs to scanned manually!

Thank you! Visweswaran N

nadif15 commented 5 years ago

all fine until i run your code maybe i got ban :(

VISWESWARAN1998 commented 5 years ago

You cannot be banned for an automation script which sends one single message.