select.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:ShuoshuoMonitor 作者: aploium 项目源码 文件源码
def select_by_value(self, value):
        """Select all options that have a value matching the argument. That is, when given "foo" this
           would select an option like:

           <option value="foo">Bar</option>

           :Args:
            - value - The value to match against
           """
        css = "option[value =%s]" % self._escapeString(value)
        opts = self._el.find_elements(By.CSS_SELECTOR, css)
        matched = False
        for opt in opts:
            self._setSelected(opt)
            if not self.is_multiple:
                return
            matched = True
        if not matched:
            raise NoSuchElementException("Cannot locate option with value: %s" % value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号