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

Added OTP automation feature via Google Messages web-application #389

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ishwarc404
Copy link

@ishwarc404 ishwarc404 commented May 28, 2021

This PR includes another way to fetch OTP via the user's browser by automating Google Message web client.

Consideration: Might require slight testing.

@bombardier-gif
Copy link
Owner

bombardier-gif commented May 28, 2021

Awesome! As the PR seems to be not tested, I will leave it here for couple of days.

At others who successfully book slots using this PR, please mention here so that we can get confidence to merge this.

@shailesh
Copy link
Collaborator

Thanks for the contribution but it seems like this is going to create more issues saying "No chromium driver found"

@ishwarc404
Copy link
Author

Thanks for the contribution but it seems like this is going to create more issues saying "No chromium driver found"

I guess that was because of selenium missing from your packages? I have updated the requirements.txt as well, for any new installs.
The README.md contains instructions as well.
The initial run of the code was tested on Windows and MacOS machines, both working fine. But yes, a few more testers required before merge.

@ishwarc404
Copy link
Author

@ishwar98 Getting an Error- ['chromedriver' executable needs to be in PATH.]

python3 src/covid-vaccine-slot-booking.py will work
python3 covid-vaccine-slot-booking.py will NOT work

otp_automation_pref = input("\nDo you want to automate the OTP using 1.Google Messages via Chrome 2. Autoread app ? (Default 2):")
if(otp_automation_pref == "1"):
print("Please scan the QR code within 20 seconds.")
messages_driver = webdriver.Chrome(executable_path=r'./src/chromedriver')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkout the path here. As most people will execute it directly from the root folder, I have added it as src/chromedriver

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make it work in both the cases? There will be people who may directly run the python file from the machine's home folder once the initial setup is done.
Restricting somebody to always navigate to a particular path and then execute is not a good practice and may confuse many.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it is possible. A simple try-except block should resolve it.

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.

5 participants