擅长:python、mysql、java
<p><strong>如果id是动态的,请找到下面的解决方案,单击“退出”按钮</strong></p>
<p><strong>1.Xpath和contains方法</p>
<pre><code>button=driver.find_element_by_xpath("//button[contains(text(), 'Wyjście')]")
button.click()
</code></pre>
<p><strong>2.类名</p>
<pre><code>element = driver.find_element_by_class_name("btn btn-inverse btn-large pull-right")
element.click()
</code></pre>