尝试使用 xPath 从 div 中获取文本。在浏览器中查找信息很好,但是当我尝试以一个想法运行时,我得到错误:“是:[对象文本]。它应该是一个元素。”
List<WebElement> priceGameWebElement = webDriver.findElements(By.xpath("//div[contains(@class,'search_price')]" +
"/text()[normalize-space()][1]"));
我需要做什么才能使一切正常?