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.
- 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
-
Clone the repository:
git clone https://github.com/yourusername/rate-automation.git cd rate-automation -
Install required dependencies:
pip install -r requirements.txt
- Python 3.6+
- Chrome browser
- Dependencies listed in requirements.txt:
- selenium
- webdriver-manager
- requests
- python-docx
Run the script:
python test.py
Follow the menu prompts:
- Run BEFORE rate change (Auto-detect rates)
- Run AFTER rate change (Extract & compare)
- Exit
-
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
-
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
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
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- 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
- No rates detected: Try adjusting the selectors in
extract_selectors()function - Accordion not expanding: Add additional button selectors to
accordion_selectorslist - Rate mismatch: Check if the website has changed its structure
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.