Interacting With Elements
On this page, you'll learn all about interacting with elements once you've located them
Introduction
Unwrapping WebElement
myElem=driver.by_tag('someTagName') #Gets some element on the page
baseSeleniumWebElement=myElem.webElement #Returns unwrapped Selenium web elementLocating Child Elements
#Page HTML looks like this:
#<div id="testElement"><p>text we want to grab</p></div>
testElement=driver.by_id("testElement") #Finds some element on the pagetestElement.by_tag("p").text() #Returns "text we want to grab"Getting Element Attributes
Get Any Attribute
Get All Attributes
Accessible Name
Accessible Role
ID
Parent
Tag Name
Location
Location Once Scrolled Into View
Rect
Size
Text
Inner HTML
Is Displayed
Is Enabled
Is Selected
List Of Methods
Clear
Click
Parent Element
Screenshot
Screenshot As Base64 String
Screenshot As PNG String
Submit Form
Get DOM Attribute
Get Property
Get CSS Property
Write
Last updated