python selenium 判断元素是否可见
生活随笔
收集整理的這篇文章主要介紹了
python selenium 判断元素是否可见
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
#在元素定位二次封裝的基礎上,封裝判斷元素是否可見,找到元素時返回True,找不到元素的時候拋出異常,返回False
def isElementPresent(self,locate_type,value):
try:
self.findElement(locate_type,value)
return True
except NoSuchElementException as e:
# print(e)
return False
def isElementPresent(self,locate_type,value):
try:
self.findElement(locate_type,value)
return True
except NoSuchElementException as e:
# print(e)
return False
轉載于:https://www.cnblogs.com/hfct/p/10984378.html
總結
以上是生活随笔為你收集整理的python selenium 判断元素是否可见的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python操作Redis(转)
- 下一篇: Win10 OpenCV3.3.0+VS