what
Selenium报错记录(报错速查表)
报错速查表如下
序号 | 报错 | 原因 | 解决方法 |
---|---|---|---|
1 | selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. | Linux服务器没有开启无头模式 | 开启无头模式即可 |
2 | 轮播图text取值部分为空 | 部分元素不可见 | 使用ele.get_attribute(‘textContent’) 取值即可 |
3 | 含义br标签的元素text属性无法提取全部文本 | 使用ele.get_attribute(‘textContent’) 取值即可 | |
4 | 有的标签tex取值时为空 | 使用ele.get_attribute(‘textContent’) 取值即可 | |
5 | selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: stale element not found in the current frame | 尝试与一个页面元素进行交互,但这个元素已经不再是当前页面的一部分了。这通常发生在页面刷新或跳转后,之前保存的元素引用就变得过时。 | 增加延时/刷新页面/重新获取元素 |