Welcome to the Banks Excahnge Rates project! This application extracts and displays exchange rate information from various bank websites. It uses configuration data from appsettings.json
to customize the scraping process for each bank.
To add a new bank, update the appsettings.json
file with the bank's details. Use the following format:
{
"BankName": "Bank Name",
"ExchangeRateWebPageUrl": "https://www.example.com/exchange-rate/",
"TableClassOrId": "class",
"TableClassOrIdValue": "table-class-or-id",
"NumberOfTableRowsToSkipFromTop": 1,
"NumberOfTableRowsToSkipFromBottom": 0,
"CurrencyCodeCellNumber": 0,
"CurrencyCodeXPath": ".//div[@class='currency-code-class']",
"CurrencyNameCellNumber": 0,
"CurrencyNameXPath": ".//div[@class='currency-name-class']",
"CurrencyBuyingCellNumber": 1,
"CurrencyBuyingXPath": null,
"CurrencySellingCellNumber": 2,
"CurrencySellingXPath": null
}
Here’s a detailed breakdown of each field in the configuration:
-
BankName
: The name of the bank. -
ExchangeRateWebPageUrl
: The URL of the bank's exchange rate webpage. -
TableClassOrId
: Indicates whether the table is identified by"class"
or"id"
. -
TableClassOrIdValue
: The class or ID of the table where exchange rates are listed. -
NumberOfTableRowsToSkipFromTop
: The number of rows to skip from the top of the table before starting to scrape. -
NumberOfTableRowsToSkipFromBottom
: The number of rows to skip from the bottom of the table. -
CurrencyCodeCellNumber
: The index of the cell containing the currency code (0-based index). -
CurrencyCodeXPath
: XPath expression used to locate the currency code in the table. -
CurrencyNameCellNumber
: The index of the cell containing the currency name (0-based index). -
CurrencyNameXPath
: XPath expression used to locate the currency name in the table. -
CurrencyBuyingCellNumber
: The index of the cell containing the buying rate (0-based index). -
CurrencyBuyingXPath
: XPath expression used to locate the buying rate (if applicable). -
CurrencySellingCellNumber
: The index of the cell containing the selling rate (0-based index). -
CurrencySellingXPath
: XPath expression used to locate the selling rate (if applicable).