0
点赞
收藏
分享

微信扫一扫

selenium弃用警告DeprecationWarning find_element_by_ commands are deprecated. Please use find_element()

c一段旅程c 2022-02-20 阅读 177
前端html

警告

DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead
  button=broser.find_element_by_xpath('//span')

find_element_by_*已被废弃

原来写法

button=broser.find_element_by_xpath('//span')

现在写法

button=broser.find_element(By.XPATH,'//span')

要事先导入就不会报错了

from selenium.webdriver.common.by import By
举报

相关推荐

0 条评论