Skip to content

Instantly share code, notes, and snippets.

@objarni
Created May 30, 2013 19:21
Show Gist options
  • Save objarni/5680411 to your computer and use it in GitHub Desktop.
Save objarni/5680411 to your computer and use it in GitHub Desktop.
Selenium-Python lathund!
# hitta element baserat på id
elem = driver.find_element_by_id('some-id')
# hitta element baserat på class
elem = driver.find_element_by_xpath("//*[contains(@class, 'some-class')]")
# hitta element baserat på del-av-id
elem = driver.find_element_by_xpath("//*[contains(@id,'some-id-substring')]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment