code: def select_by_visible_text(self, text):
          
          xpath = ".//option[normalize-space(.) = %s]" % self._escapeString(text)
          opts = self._el.find_elements(By.XPATH, xpath)
          matched = False
          for opt in opts:
              self._setSelected(opt)
              if not self.is_multiple:
                  return
              matched = True
  
          if len(opts) == 0 and " " in text:
              subStringWithoutSpace = self._get_longest_token(text)
              if subStringWithoutSpace == "":
                  candidates = self.options
              else:
                  xpath = ".//option[contains(.,%s)]" % self._escapeString(subStringWithoutSpace)
                  candidates = self._el.find_elements(By.XPATH, xpath)
              for candidate in candidates:
                  if text == candidate.text:
                      self._setSelected(candidate)
                      if not self.is_multiple:
                          return
                      matched = True
  
          if not matched:
              raise NoSuchElementException("Could not locate element with visible text: %s" % text)
docs: Select all options that display text matching the argument. That is, when given "Bar" this
             would select an option like:
  
              <option value="foo">Bar</option>
  
             :Args:
              - text - The visible text to match against
  
              throws NoSuchElementException If there is no option with specified text in SELECT