HardwareScraper is a specialized web scraping tool designed to extract product information from multiple hardware and computer e-commerce websites with varying HTML structures. The project is modularized to easily add new websites and handle different HTML layouts, making it a robust solution for aggregating hardware product data.
- Scrape product information from multiple hardware and computer e-commerce websites.
- Modular design to easily add new websites.
- Handles different HTML structures.
- Extracts product details such as name, URL, price, image URL, and stock status.
- Saves scraped data to an Excel file.
- Sigma Computer
- Elnekhely Technology
- Elbadr Group
-
Clone the repository:
git clone https://github.com/ahmedelzagh/HardwareScraper.git cd HardwareScraper -
Install the required dependencies:
pip install -r requirements.txt
-
Update the
websiteslist inmain.pyto include the websites you want to scrape. -
Run the scraping process:
python main.py
-
The scraped data will be saved to
scraped_products.xlsx.
- Create a new scraper class for the website by extending
WebsiteScraper. - Implement the
extract_product_itemsandextract_product_detailsmethods. - Update the
ScraperFactoryto include the new scraper. - Add the new website to the
websiteslist inmain.py.
# Example of adding a new website to the websites list in main.py
websites = [
{
'base_url': 'https://example.com',
'store_name': 'Example Store',
'categories': {
'Category1': 'category1',
'Category2': 'category2'
}
}
]Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.