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

beginners guide #941

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

beginners guide #941

wants to merge 1 commit into from

Conversation

collinsuzebu
Copy link

No description provided.

@sergeByishimo
Copy link

This guide actually helped me. Thanks

@collinsuzebu
Copy link
Author

Good to know. You're welcome. If you had to figure out additional steps, let me know too so I can add it. :)

@sergeByishimo
Copy link

Great, Yeah, Whatsapp on login changes the QR every 20 seconds for 5 or 6 times and then you have to click to reload your QR (which I think the driver.reload_qr() does),

So, I'm trying to figure out how to automatically catch the changed QR code every 10 seconds and save it also until it stops changing and then I have to call the driver.reload_qr() after it stopped changing.

@sergeByishimo
Copy link

Also saving the profile seems to not work when I re run this command :

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"

I have to scan for the QR again.

I'm using the remote setup and using the VNC viewer

@sergeByishimo
Copy link

Thanks for the consideration.

@collinsuzebu
Copy link
Author

I agree with previous profile not getting loaded even after been saved. There was a work around I did for a project where I used it, I'd check with the organization team if I could still get access to the private repo.

For the other problem you mentioned, the login process does not work that way. Once logged in with a qr_code, the account remain logged in. The qr_code expires quickly (<60secs) and can only be used once.

@sergeByishimo
Copy link

I referred to your guide and I did it like below, which seems to work, even after I restarted the containers the session was still there

profiledir = os.path.join(".", "/app/firefox_cache") # this is a directory
driver = WhatsAPIDriver(profile=profiledir, client="remote", command_executor=os.environ["SELENIUM"])

@collinsuzebu
Copy link
Author

Yes, the session persist even after the container is shutdown. You could always implement a functionality that destroys created session when containers are shutdown.

Take a look at this issue for restoring previous session on startup.

@sergeByishimo
Copy link

Any idea on how to reuse the same window instead of creating a window every time you run a python script.
Thanks.

@collinsuzebu
Copy link
Author

I can't be sure, but I haven't come across the API for that. What has helped me in the passed was gracefully shutting down a window when the application quits. driver.close()

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

Successfully merging this pull request may close these issues.

2 participants