This repository contains two separate tools:
- Amazon Scraper - A Selenium-based scraper for extracting sponsored product data from Amazon.
- YouTube Video Analyzer - A Streamlit application that finds and recommends the most relevant YouTube videos based on a search query.
The Amazon Scraper tool uses Selenium to scrape sponsored product information from Amazon's search results. It specifically targets the "soft toys" category and extracts details like:
- Product title
- Brand name
- Price
- Rating
- Number of reviews
- Product image URL
- Product page URL
- amazon_sponsored_softtoys.csv - CSV file containing the scraped data
- app.py - The main Python script for scraping Amazon
- analysis.ipynb - Jupyter notebook for analyzing the scraped data
-
Install the required packages:
pip install selenium pandas webdriver-manager
-
Run the scraper:
cd amazon-scraper python app.py
- Headless browser operation for faster scraping
- Detailed product information extraction
- Brand detection from product pages
- CSV output for easy data analysis
The YouTube Video Analyzer is a Streamlit application that helps users find the most relevant YouTube videos based on their search query. It uses:
- YouTube Data API for searching videos
- Google Speech Recognition for voice input
- Google's Gemini AI for analyzing video relevancy
- app.py - Main Streamlit application
- requirements.txt - Required Python packages
- .env - Environment variables for API keys (not included in repository)
-
Install the required packages:
cd youtube-assignment pip install -r requirements.txt -
Create a
.envfile with your API keys:YOUTUBE_API_KEY=your_youtube_api_key GOOGLE_API_KEY=your_google_api_key -
Run the Streamlit application:
streamlit run app.py
- Search for YouTube videos published in the last 14 days
- Filter videos by duration (4-20 minutes)
- Voice input for search queries
- AI-powered video relevance ranking
- Embedded video player for the most relevant result
- Python 3.7+
- Selenium
- Pandas
- Webdriver-manager
- Python 3.7+
- Streamlit
- Google API Python Client
- Google Generative AI
- Speech Recognition
- PyAudio
- isodate