Finding Elements
XPaths
Inspect Element
Copy XPath
You get:
//*[@id="id"]/tag/anothertag
Remove star and find last tag and insert it at the front of XPath:
driver.find_element_by_xpath("//tag[@id="id"]/tag/anothertag")
Clicking
option = driver.find_element... option.click()
Get all links on page
elems = driver.find_elements_by_xpath("//a[@href]")
for elem in elems:
print elem.get_attribute("href")
Last updated
Was this helpful?