def set_select_by_text(self, select, text):
'''
Set the selected value of a select element by the visible text.
Parameters
----------
select: str or selenium.webdriver.remote.webelement.WebElement
Any valid CSS selector or a selenium element
text: str
The visible text in the select element option. (Not the value)
'''
if isinstance(select, str):
elem = self.get_element(select)
else:
elem = select
sel = Select(elem)
sel.select_by_visible_text(text)
评论列表
文章目录