Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itachi1621/g2a_scraper

Python script scrapes product information from G2A, extracts pricing, ratings, and seller names, creates an HTML table using ChatGPT, and sends email notifications to recipients specified in the configuration file.
https://github.com/itachi1621/g2a_scraper

chatgpt chrome chromium g2a mailersend openai python python-3 python-script python3 selenium web-scraper web-scraping web-scraping-python

Last synced: about 1 month ago
JSON representation

Python script scrapes product information from G2A, extracts pricing, ratings, and seller names, creates an HTML table using ChatGPT, and sends email notifications to recipients specified in the configuration file.

Awesome Lists containing this project

README

        

# G2A Product Scraper and Email Notifier

This Python script scrapes product information from G2A, extracts pricing, ratings, and seller names, creates an HTML table using ChatGPT, and sends email notifications to recipients specified in the configuration file.

## Prerequisites

- Python 3.x
- Required Python packages (install via `pip`):
- `dotenv`
- `bs4` (BeautifulSoup)
- `requests`
- `mailer-send`
- Chrome or Chromium
## Setup

1. Clone this repository:

```bash
git clone https://github.com/itachi1621/G2A_Scraper

2. Install Dependencies

```bash
pip install -r requirements.txt

3. Create a .env file in the root directory and add the following environment variables:
```plaintext
MAILERSEND_API_KEY=your_mailersend_api_key
[email protected]
MAILERSEND_FROM_NAME=Your Name
OPENAI_API_KEY=your_openai_api_key
OPENAI_CONFIG_LOCATION=path_to_openai_config_file
G2A_CONFIG_LOCATION=path_to_g2a_config_file
SELENIUM_IMPLICIT_WAIT_TIME=your_selenium_implicit_wait_time
TIMER_WAIT_TIME=your_timer_wait_time
```

### Notes
** config locations should use the full path to the file

## Usage
Run the script.
```bash
python G2A_Scraper.py
```
## Configuration
- G2A Configuration File: Configure products and target prices in the `configs/g2a_config.json` JSON file.
- OpenAI Configuration File: Configure OpenAI settings in the `configs/openai_config.json` JSON file.

## Custom Functions
- mailersend_funcs: Functions related to sending emails using MailerSend.
- scrapping_funcs: Functions for scraping websites.
- openai_funcs: Functions for interacting with OpenAI.

## Summary
1. Scraping Products from G2A:
- The script scrapes product information from G2A, as defined in the g2a_config file.
2. Extracting Information:
- It extracts pricing, ratings, and names of various sellers for each product.
3. HTML Table Creation:
- Using ChatGPT, it creates an HTML table containing the scraped data.
4. Email Notification:
- The script sends an email to recipients specified in the g2a_config file.
- The email notifies recipients of items available around their target price.