Playwright · Method
locator.textContent
locator.text_content() returns the DOM textContent of the matched element. It returns a string or None and waits for the locator up to the configured timeout.
Last updated
- Since
- v1.14
Syntax
locator.text_content(timeout=timeout)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
locator.all_text_contentslocator.all_inner_textsexpect(locator).to_have_textlocator.inner_text