Links, Alerts & Frames/iFrames
Working With Links: 1. How many links present in a webpage. 2. Capture all the links in a webpage 3. Click on the specific link using LINK TEXT or PARTIAL LINK TEXT. from selenium import webdriver driver=webdriver.Chrome(executable_path="D:\Selenium\Browsers\chromedriver_win32\chromedriver.exe") driver.get("http://demo.guru99.com/test/newtours/") links = driver.find_elements_by_tag_name("a") print("number of Links:", len(links)) #number of links for link in links: #capture all the links print(link.text) #driver.find_element_by_link_text("REGISTER").click() driver.find_element_by_partial_link_text("REG").click() #click on the link driver.quit() Alerts: driver.switch_to.alert.accept() driver.switch_to.alert.dismiss() Alert is nothing but a kind of pop up by which we cannot identify the element in the pop up. from selenium import webdriver import time driver=webdriver.Chrome(executable...