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

Update amazon.py #662

Merged
merged 2 commits into from
Dec 26, 2023
Merged

Conversation

RishavRaj20
Copy link
Contributor

  1. Exception Handling: The code currently catches broad requests. exceptions.RequestException. It's better to catch more specific exceptions like requests. exceptions.HTTPError for HTTP errors.

  2. User-Agent String: You might want to replace the placeholder "Your User Agent Here" with a valid user-agent string. You can find user-agent strings online or use the one from your browser's network requests.

  3. Function Parameters: Instead of hardcoding the product URL inside the script, you can modify the 'check_amazon_availability' function to accept the URL as a parameter. This makes the function more flexible.

Type of change

  • Added new project
  • Bug fix
  • New features
  • Enhanced documentation

Changes proposed in this pull request

  • Project name :

  • Short description :

Checklist

  • The code is Python 3 compatible
  • I have added relevant comments in my file to make code understandable
  • I have added my project in a folder which includes all the necessary files

1) Exception Handling: The code currently catches broad requests. exceptions.RequestException. It's better to catch more specific exceptions like requests. exceptions.HTTPError for HTTP errors.

2) User-Agent String: You might want to replace the placeholder "Your User Agent Here" with a valid user-agent string. You can find user-agent strings online or use the one from your browser's network requests.

3) Function Parameters: Instead of hardcoding the product URL inside the script, you can modify the 'check_amazon_availability' function to accept the URL as a parameter. This makes the function more flexible.
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Greetings! This is an automated message from GitHub Actions. 🤖
Your pull request has been received and is awaiting for a review by the repository owner or a maintainer. This may take some time, so please be patient.
While you wait, you can continue to work on other issues or pull requests, or explore the project further. Or you can simply relax and enjoy your day.
Thank you for your contribution to this project! You are awesome! ⭐

@Mrinank-Bhowmick
Copy link
Owner

Thanks for your changes ⭐

@Mrinank-Bhowmick Mrinank-Bhowmick merged commit 9a31705 into Mrinank-Bhowmick:main Dec 26, 2023
yanfd pushed a commit to yanfd/python-beginner-projects that referenced this pull request Jan 30, 2025
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