我想将"The id you entered does not exist in our database. Please note, ids are case and space sensitive."
存储在变量中。
<p class="message fail"> The id you entered does not exist in our database. Please note, ids are case and space sensitive. </p>
答案 0 :(得分:2)
尝试:
your_variable = driver.find_element(:class, 'message fail').text
.text
方法将为您提供元素的文本。