Skip to content

Update scrapping.py #205

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

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Update scrapping.py #205

merged 1 commit into from
Jun 27, 2024

Conversation

bhanushri12
Copy link
Contributor

Enhanced the listing of products into the csv file.

#167

Description

Enhanced the script (pull request #167) to scrape product listings and prices from Amazon for specified categories (Laptop, Phones, Printers, etc.) and save them into a structured CSV file (prod_listings.csv). Each entry includes the category, product name, and price.

Type of PR

  • Feature enhancement

Changes Made

for name in names:
products, prices = product_listing(name)
all_product_listings.extend(products)
all_product_prices.extend(prices)
category.extend([name] * len(products)) # Extend category list with repeated entries for each product

Checklist:

  • I have performed a self-review of my code
  • I have read and followed the Contribution Guidelines.
  • I have tested the changes thoroughly before submitting this pull request.
  • I have provided relevant issue numbers, screenshots, and videos after making the changes.
  • I have commented my code, particularly in hard-to-understand areas.

Additional context:

The script now uses Selenium to scrape Amazon for multiple product categories, captures both product names and prices, and organizes the data into a CSV file format for easy analysis.

Explanation:

•	Enhanced Script: Modified the existing script (from pull request #167) to iterate over a list of predefined product categories, scrape product names and prices using Selenium, and save the data into a structured CSV file.
•	Data Organization: Each row in the CSV file contains three columns: Category, Product Name, and Price, making it easy to analyze and compare product listings across different categories.
•	WebDriver Usage: Utilized WebDriver (ChromeDriver) to automate browsing tasks, handle dynamic content loading, and ensure accurate data extraction from Amazon’s search results.

Enhanced the listing of products into the csv file.
@sanjay-kv sanjay-kv merged commit a76dd2a into recodehive:main Jun 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants