Py-Contributors / awesomeScripts

A Collection of Awesome Scripts in Python to Ease Daily-Life. Create an issue If you have some great ideas for the new script. Leave a :star:
https://py-contributors.github.io/awesomeScripts/
MIT License
579 stars 274 forks source link

amazon-price-alert doesn't validate frequency entry #357

Closed habereet closed 3 years ago

habereet commented 3 years ago

Describe the bug In amazon-price-alert when entering the rate that the URL should be checked, entering a value that isn't one of the options doesn't return an error.

To Reproduce Steps to reproduce the behavior:

  1. Install the required libraries
  2. Run the script - python amazon_scraper.py
  3. Enter a valid URL for the URL when requested for the link to the product
  4. Enter an email address or a string that looks like an email address
  5. When asked for a frequency, enter a value that's not in the list
    • number - The script continues as if the user entered an accepted value
    • character - the script errors with a ValueError
    • nothing - the script errors with a ValueError

Expected behavior The script should handle exceptions and test input. When not valid, it should prompt the user for a valid value then exit if they're unable to provide one.

Screenshots If applicable, add screenshots to help explain your problem. image

image

image

Desktop (please complete the following information):

habereet commented 3 years ago

Please assign to me

habereet commented 3 years ago

Submiitted Pull Request #362 to resolve this.