The script below uses Helium to automatically extract the exchange rates from EUR to USD and from USD to JPY from the corresponding Yahoo Finance page. Once it has extracted them, it prints them on the console.

import static com.heliumhq.API.*;
import org.openqa.selenium.WebDriver;

public class ExchangeRatesExample {

    public static void main(String[] args) {
        System.out.println(getExchangeRate("EUR", "USD"));
        System.out.println(getExchangeRate("USD", "JPY"));

    private static String getExchangeRate(
        String baseCurrency, String counterCurrency
    ) {
        String currencyPair = baseCurrency + counterCurrency;
            "", currencyPair
        return $(".time_rtq_ticker").getWebElement().getText();

from helium.api import *

def get_exchange_rate(base_currency, counter_currency):
    currency_pair = base_currency + counter_currency
    go_to("" % currency_pair)
    return S('.time_rtq_ticker').web_element.text

print get_exchange_rate("EUR", "USD")
print get_exchange_rate("USD", "JPY")

To try the script for yourself, follow the few simple steps on our Getting Started page. Then, execute the script run.bat/ in the examples/Exchange rates subdirectory of your Helium installation.