Playwright Python - Inner Text Locator

Описание к видео Playwright Python - Inner Text Locator

In this video you'll learn how to locate web elements using their inner text.

Find an element by the text it contains. You can match by a substring, exact string, or a regular expression when using page.get_by_text(). You can locate the element by the text it contains, or set an exact match.

Matching by text always normalizes whitespace, even with exact match. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace.

🔧 When to use?
Playwright recommends using text locators to find non interactive elements like div, span, p, etc. For interactive elements like button, a, input, etc. use role locators.

✨ Ultimate Guide to Python 3.10 🐍 - http://bit.ly/pywizard
✨ Full Playwright Course 🎭 - https://bit.ly/playwright-auto

Playwright is a modern, fast and reliable browser automation tool from Microsoft that enables testing and automation across all modern browsers including chromium, firefox and webkit.

Комментарии

Информация по комментариям в разработке