def webpage_attribute_getter(attr):
    """ Helper function for defining getters for web_page attributes, e.g.
    ``get_foo_enabled = webpage_attribute_getter("foo")`` returns
    a value of ``webpage.foo`` attribute.
    """
    def _getter(self):
        return getattr(self.web_page, attr)
    return _getter