Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WA web got hanged up #18

Open
frozenade opened this issue Mar 9, 2019 · 8 comments
Open

WA web got hanged up #18

frozenade opened this issue Mar 9, 2019 · 8 comments
Assignees
Labels

Comments

@frozenade
Copy link

It runs and just shows 'data:;' at Chrome's addressbar.

Please help

@VISWESWARAN1998
Copy link
Owner

@frozenade
Try updating your chrome browser and please do use the latest chrome-driver.

If you still face the issue please let me know.

@frozenade
Copy link
Author

my both Chrome and Selenium driver are the latest version.

@VISWESWARAN1998
Copy link
Owner

@frozenade could you please send me the code which you are using.

@frozenade
Copy link
Author

I just run your code. I didn't modify the code at all.

@VISWESWARAN1998
Copy link
Owner

@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

@frozenade
Copy link
Author

frozenade commented Mar 13, 2019

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:

@VISWESWARAN1998
Copy link
Owner

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 :)")

@frozenade
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants