def value(self):
        """
        Get/set the value of this select (the selected option).

        If this is a multi-select, this is a set-like object that
        represents all the selected options.
        """
        if self.multiple:
            return MultipleSelectOptions(self)
        options = _options_xpath(self)

        try:
            selected_option = next(el for el in reversed(options) if el.get('selected') is not None)
        except StopIteration:
            try:
                selected_option = next(el for el in options if el.get('disabled') is None)
            except StopIteration:
                return None
        value = selected_option.get('value')
        if value is None:
            value = (selected_option.text or '').strip()
        return value

        Get/set the value of this select (the selected option).

        If this is a multi-select, this is a set-like object that
        represents all the selected options.
        
stackoverflow/venv/lib/python3.6/site-packages/lxml/html/__init__.py