Python Selenium、Firefox、错误检查页面上是否有ID?
对不起,如果这是一种模糊,我不知道如何解释它,但基本上我正在尝试运行一个功能,检查一个ID是否在一个页面上,我不知道如何做。这是我迄今为止尝试的代码Python Selenium、Firefox、错误检查页面上是否有ID?,python,selenium,firefox,webdriver,Python,Selenium,Firefox,Webdriver,对不起,如果这是一种模糊,我不知道如何解释它,但基本上我正在尝试运行一个功能,检查一个ID是否在一个页面上,我不知道如何做。这是我迄今为止尝试的代码 def checkoutpage(): driver1.find_element_by_id('test') try: if checkoutpage == True: print("Working") else: print("Not working") except: print
def checkoutpage():
driver1.find_element_by_id('test')
try:
if checkoutpage == True:
print("Working")
else:
print("Not working")
except:
print("ERROR")
无论ID是否在页面上,它都返回不起作用,非常感谢您的帮助。另一个简单示例的可能重复