python selenium 判断元素是否可见

1 #在元素定位二次封装的基础上,封装判断元素是否可见,找到元素时返回True,找不到元素的时候抛出异常,返回False
2 def isElementPresent(self,locate_type,value):
3     try:
4        self.findElement(locate_type,value)
5        return True
6     except NoSuchElementException as e:
7         # print(e)
8         return False
原文地址:https://www.cnblogs.com/hfct/p/10984378.html