import codecs


def splinter_screenshot_getter_html(splinter_screenshot_encoding):
    """Screenshot getter function: html."""

    def getter(browser, path):
        with codecs.open(path, "w", encoding=splinter_screenshot_encoding) as fd:
            fd.write(browser.html)

    return getter