异常捕捉

在课堂上的有用到try捕捉异常

try:
driver.implicitly_wait(10)
driver.get('https://www.jd.com/')
input_tag.send-keys('中华字典')
input_tag.send_keys(Keys.ENTER)
time.sleep(10)
except Exception as e :
finally:
driver.close()

  

猜你喜欢

转载自www.cnblogs.com/513142527yk/p/11111032.html