我正在写一个python selenium脚本。我想选择下面的课程:
<select style="position: absolute; left: 0px; top: 0px;" class="gwt-ListBox project-list">
<option value="10">Case Notes</option>
但失败了:
elem = self.driver.find_element_by_xpath("//contains[@class=gwt-ListBox.project-list']")
任何人都可以探索。
答案 0 :(得分:0)
实际上你在'
之后错过了引用=
。以下内容适用:
elem = self.driver.find_element_by_xpath("//contains[@class='gwt-ListBox.dashboard-listbox.project-list']")
希望它有效
答案 1 :(得分:0)
试试这个Xpath
"//select[@class='gwt-ListBox project-list']"