我正在尝试使用xpath从页面中查找特定文本。硒找不到此确切的文本。
这是我尝试使用的代码:
searchresult = self.driver.find_element_by_xpath("//*[contains(text(), 'Sorry, we could not find the book you were looking for.')]")
这是我正在使用的HTML:
<div style="width:100%;padding: 20px;">
<div class="searchbox">
</div>
<div class="vert-spacing-15"></div>
Sorry, we could not find the book you were looking for. Please try
searching for something else.
</div>