Skip to main content
Page content methods for the Playwright driver.

getAttribute

Get an attribute value from an element.
Deprecated: Use locator.getAttribute() instead.
Upstream docs
selector
string
required
name
string
required
options
{ strict?: boolean; timeout?: number }
result
string | null
Return value
await page.getAttribute('...', '...');

textContent

Get the text content of an element.
Deprecated: Use locator.textContent() instead.
Upstream docs
selector
string
required
options
{ strict?: boolean; timeout?: number }
result
string | null
Return value
await page.textContent('...');

innerText

Get the inner text of an element.
Deprecated: Use locator.innerText() instead.
Upstream docs
selector
string
required
options
{ strict?: boolean; timeout?: number }
result
string
Return value
await page.innerText('...');

innerHTML

Get the inner HTML of an element.
Deprecated: Use locator.innerHTML() instead.
Upstream docs
selector
string
required
options
{ strict?: boolean; timeout?: number }
result
string
Return value
await page.innerHTML('...');

inputValue

Get the input value of an element.
Deprecated: Use locator.inputValue() instead.
Upstream docs
selector
string
required
options
{ strict?: boolean; timeout?: number }
result
string
Return value
await page.inputValue('...');