Skip to content

Mujeeb4/Rate-Automation

Repository files navigation

Rate Automation Tool

This project automates interest rate monitoring across bank websites. It captures rates before and after changes, verifies them against official JSON data, and generates detailed reports with screenshots. The tool is designed for financial analysts and bank employees who need to validate that rate changes are correctly applied across all web properties.

Features

  • Automatic Rate Detection: Identifies and extracts interest rates from web pages
  • JSON Data Integration: Compares website rates with official JSON data sources
  • Before/After Comparison: Captures rates before and after changes for verification
  • Accordion Expansion: Automatically expands collapsible sections to find hidden rates
  • Screenshot Documentation: Takes screenshots at each step for visual verification
  • Detailed Reporting: Generates Word documents with tables and screenshots showing all changes

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/rate-automation.git
    cd rate-automation
    
  2. Install required dependencies:

    pip install -r requirements.txt
    

Requirements

  • Python 3.6+
  • Chrome browser
  • Dependencies listed in requirements.txt:
    • selenium
    • webdriver-manager
    • requests
    • python-docx

Usage

Basic Usage

Run the script:

python test.py

Follow the menu prompts:

  1. Run BEFORE rate change (Auto-detect rates)
  2. Run AFTER rate change (Extract & compare)
  3. Exit

Workflow

  1. Before Rate Change:

    • Run option 1 before rates change
    • The tool will scan URLs from urls.txt
    • It automatically detects and stores rate locations
    • JSON data is captured for comparison
  2. After Rate Change:

    • Run option 2 after rates have changed
    • The tool will revisit the same URLs
    • It extracts the new rates at previously identified locations
    • Compares the website rates with JSON data
    • Generates a comprehensive report

Configuration

urls.txt

Add URLs to monitor (one per line):

https://www.westpac.com.au/personal-banking/home-loans/variable/basic-variable-home-loan/
https://www.stgeorge.com.au/personal/home-loans/home-loan-interest-rates/table

config.py

Configure settings like wait times and screenshot options:

# File containing URLs to scrape
URLS_FILE = "urls.txt"

# Wait times (in seconds)
PAGE_LOAD_WAIT = 10
ELEMENT_WAIT = 5

# Screenshot settings
TAKE_SCREENSHOTS = True

Output Files

  • before_data.json: Captured rates before change
  • after_data.json: Captured rates after change
  • rate_location_map.json: Stored XPaths to rate elements
  • rate_change_report_[timestamp].docx: Detailed Word report with tables and screenshots
  • BEFORE_CHANGE_JSONs/: Directory containing JSON data before change
  • AFTER_CHANGE_JSONs/: Directory containing JSON data after change
  • screenshots/: Directory containing all screenshots

Troubleshooting

  • No rates detected: Try adjusting the selectors in extract_selectors() function
  • Accordion not expanding: Add additional button selectors to accordion_selectors list
  • Rate mismatch: Check if the website has changed its structure

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages