import requests
from bs4 import BeautifulSoup


def LoadSellmeier(url):
    """Loads Sellmeier's formula from RefractiveIndex.INFO.

    Arguments:
    url -- link to the material's formula page
    """
    page = requests.get(url)
    assert page.status_code != 404, "No formula found at the given URL"
    soup = BeautifulSoup(page.content, 'html.parser')
    formulas = soup.find_all("code")
    sellmeier = str(formulas[1])[8:-7]

    return(sellmeier)