Phantomime.py 文件源码

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

项目:Phantomime 作者: psyb0t 项目源码 文件源码
def select_option(select_el, by, val):
  """Select an option from a select dropdown

  Arguments:
  select_el -- the Selenium WebDriver Element select dropdown
  by -- the type of the value used (index | text | value)
  val -- the value of the option to select
  """
  select = Select(select_el)

  if by == 'index':
    return select.select_by_index(val)
  elif by == 'text':
    select.select_by_visible_text(val)
  elif by == 'value':
    select.select_by_value(val)
  else:
    raise Exception('Invalid SELECT BY type')

  return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号