Abnormal capture

Useful in the classroom to try to catch exceptions

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()

  

Guess you like

Origin www.cnblogs.com/513142527yk/p/11111032.html