Open frozenade opened 5 years ago
@frozenade Try updating your chrome browser and please do use the latest chrome-driver.
If you still face the issue please let me know.
my both Chrome and Selenium driver are the latest version.
@frozenade could you please send me the code which you are using.
I just run your code. I didn't modify the code at all.
@frozenade I seriously believe you are directly running whatsapp.py something like this,
python whatsapp.py
You should create a new file and get the object of WhatsApp class so that you can actually utilize the API.
For example, Let us create a file named group.py in the same directory where whatsapp.py and chromedriver is located with the following code,
# SWAMI KARUPPASWAMI THUNNAI
from whatsapp import WhatsApp
app = WhatsApp(10)
app.override_timeout(30)
app.join_group("https://chat.whatsapp.com/4AIA2B3GuLp4RJOKF0M8zY")
app.send_blind_message("I am in :)")
Then run,
python group.py
Ah yes. Finally it's works. But another error message comes:
Traceback (most recent call last):
File "D:\Python\Simple-Yet-Hackable-WhatsApp-api-master\group.py", line 5, in <module>
app = WhatsApp(10)
File "D:\Python\Simple-Yet-Hackable-WhatsApp-api-master\whatsapp.py", line 51, in __init__
(By.CSS_SELECTOR, '.jN-F5')))
File "D:\Python\Python37\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
The only thing which you have do manually is to scan the QR code
10 in the constructor specifies that the API will wait for 10 seconds to scan for the code.
app = WhatsApp(10)
Specify something like 1000 to prevent this exception like this,
app = WhatsApp(1000)
So finally, test the whole code:
# SWAMI KARUPPASWAMI THUNNAI
from whatsapp import WhatsApp
app = WhatsApp(1000)
app.override_timeout(30)
app.join_group("https://chat.whatsapp.com/4AIA2B3GuLp4RJOKF0M8zY")
app.send_blind_message("I am in :)")
Thanks but I still got error message:
==== RESTART: D:\Python\Simple-Yet-Hackable-WhatsApp-api-master\group.py ====
No alert Found
Traceback (most recent call last):
File "D:\Python\Simple-Yet-Hackable-WhatsApp-api-master\group.py", line 5, in <module>
app.join_group("https://chat.whatsapp.com/JKjXKduRG97L01l307FXWA")
File "D:\Python\Simple-Yet-Hackable-WhatsApp-api-master\whatsapp.py", line 334, in join_group
WebDriverWait(self.browser, self.timeout).until(EC.presence_of_element_located((By.XPATH, '//*[@id="app"]/div/span[3]/div/div/div/div/div/div/div[2]/div[2]')))
File "D:\Python\Python37\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Is it normal?
It runs and just shows 'data:;' at Chrome's addressbar.
Please help