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.
On this page of the site you can watch the video online Playwright Python - Inner Text Locator with a duration of hours minute second in good quality, which was uploaded by the user Rahul Mula 24 June 2023, share the link with friends and acquaintances, this video has already been watched 1,945 times on youtube and it was liked by 26 viewers. Enjoy your viewing!