本文整理汇总了Python中selenium.webdriver.support.ui.Select.send_keys方法的典型用法代码示例。如果您正苦于以下问题:Python Select.send_keys方法的具体用法?Python Select.send_keys怎么用?Python Select.send_keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.support.ui.Select
的用法示例。
在下文中一共展示了Select.send_keys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: filter
# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
def filter(self, name, value):
"""filters the table by using value for the column specified by name.
Note that this abstracts the different ways filter controls can be implemented.
"""
filter_ = self.e.find_element_by_id('dt-filter-%s' % name)
if filter_.find_elements_by_tag_name('option'):
filter_ = Select(filter_)
filter_.select_by_visible_text(value)
else:
filter_.send_keys(value)
time.sleep(2.5)
示例2: impl
# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
def impl(context):
dropdown = Select(find_id_with_wait(context, "group-select"))
dropdown.select_by_visible_text("0")
# For some reason this only triggers properly if you defocus or press enter after the select
dropdown = find_id_with_wait(context, "group-select")
dropdown.send_keys(Keys.RETURN)
示例3: Select
# 需要导入模块: from selenium.webdriver.support.ui import Select [as 别名]
# 或者: from selenium.webdriver.support.ui.Select import send_keys [as 别名]
for (key,value) in shipping_info_next:
ele_selector = key
ele = Select(driver.find_element(By.ID,ele_selector))
ele.select_by_visible_text(value)
#
shipping_info_next = {
'address_zip' : '80302',
}
time.sleep(SLEEP_SECS)
for key,value in shipping_info_next.iteritems():
ele_selector = key
ele = driver.find_element_by_id(ele_selector)
ele.send_keys(value)
#
shipping_info_next = {
'speed' : 'speed-std',
}
time.sleep(SLEEP_SECS)
for key,value in shipping_info_next.iteritems():
ele_selector = key
ele = driver.find_element_by_id(value)
ele.click()
#click add to cart
time.sleep(SLEEP_SECS)
ele_number = 0