import sys
from selenium import webdriver
try:
driver= webdriver.Chrome()
driver.get("http://www.baidu.com")
#定位名为dog的元素失败
driver.find_element_by_name('dog')
except Exception:
print(sys.exc_info()[1])
import sys
from selenium import webdriver
try:
driver= webdriver.Chrome()
driver.get("http://www.baidu.com")
#定位名为dog的元素失败
driver.find_element_by_name('dog')
except Exception:
print(sys.exc_info()[1])