italoseara / whatsappy

A whatsapp api made with selenium in Python
MIT License
43 stars 8 forks source link

Change default value for `visible` option on `Whatsapp.login` #4

Closed yohannd1 closed 3 years ago

yohannd1 commented 3 years ago

It seems this library doesn't work on linux yet. I'm still figuring out why, though.

yohannd1 commented 3 years ago

Found the issue! It wasn't really a code bug (or even a linux issue), but rather a bad default option:

def login(self, visible: bool = False, timeout: int = 60):

For a starter, trying to login, no matter what browser is being used, might end up with a frozen session. That happens because they didn't set visible to true, and they won't log in automatically.

The best to do here is to set the default value of visible to True. We could also find some way to error out when the window is not visible and the login was not done yet, but I'm not very familiar with JS so I can't help with that :')

italoseara commented 3 years ago

thanks for the tip, it will be updated on the next version