WebDriver
-
Python으로 Selenium 이용 시 Element CheckPython 2019. 4. 15. 17:55
1. from selenium.common.exceptions import NoSuchElementException # Import 추가 2. try - except 방법 try: element = driver.find_element_by_partial_link_text("text") except NoSuchElementException: print("No Found") 3. if로 element check if not element: print("No Element found") else: driver.find_element_by_xpath("""Copy XPath""").click()