我正在使用 Python 中的 Selenium。我想得到.val()
一个<select>
元素并检查它是否是我所期望的。
这是我的代码:
def test_chart_renders_from_url(self):
url = 'http://localhost:8000/analyse/'
self.browser.get(url)
org = driver.find_element_by_id('org')
# Find the value of org?
我怎样才能做到这一点?Selenium 文档似乎有很多关于选择元素的内容,但没有关于属性的内容。