/currency-scraper

This repository contains a python script that scrape some currencies data from the website xe.com.

Primary LanguagePythonApache License 2.0Apache-2.0

Currency Scraper

Description

This repository contains a python script that scrape some currencies data from the website xe.com.

Features

The scraped data for each currencies are:

  • Currency Name
  • ISO Code
  • Symbol
  • Commonly Used Coins
  • Commonly Used Banknotes
  • Central Bank Name
  • Central Bank Website
  • Primary Users of the Currency

Data Storage: Organizes and stores the scraped data in a structured CSV file, facilitating easy access and analysis.

The file scraped_currencies.csv is an example of a generated CSV file.

Logging: Implements logging to track the script's operation and any issues encountered during the scraping process.

Installation

To run this script, you need Python 3.x and the following packages:

  • requests: For making HTTP requests to the website.
  • BeautifulSoup: For parsing the HTML content and extracting data.

Install the required packages using pip and the provided requirements.txt file:

pip install -r requirements.txt

A python virtualenv may be used to install the dependencies.

Usage

usage: main.py [-h] [-o OUTPUT] [-l LOG]

Scrape currencies from https://www.xe.com/ and writes a CSV file.

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        CSV file name
  -l LOG, --log LOG     LOG file name

Contributing

Contributions to enhance the script or fix issues are welcome. Please feel free to fork the repository, make your changes, and submit a pull request.

Ethical Considerations

Please ensure that your use of this script complies with XE.com's Terms of Service and respects the website's robots.txt file. Avoid making excessive requests that could impact the website's performance.

License

This project is Open Source and is available under the Apache License 2.0.

Disclaimer

This script is provided for educational purposes only. The author is not responsible for any misuse or damage resulting from the use of this script.