Playwright Python - CSS Selector Pseudo Classes

Veröffentlicht am: 11 Juli 2023
auf dem Kanal: Rahul Mula
1,019
10

In this video you'll learn how to locate web elements using special css selector pseudo classes.

Playwright include a number of CSS pseudo-classes to locate elements:
- `:has-text()` matches any element containing specified text somewhere inside, possibly in a child or a descendant element. Matching is case-insensitive, trims whitespace and searches for a substring.

- `:text()` pseudo-class matches the smallest element containing specified text. Matching is case-insensitive, trims whitespace and searches for a substring.

- `:visible` pseudo class. For example, css=button matches all the buttons on the page, while css=button:visible only matches visible buttons. This is useful to distinguish elements that are very similar but differ in visibility.

- Sometimes page contains a number of similar elements, and it is hard to select a particular one. `:nth-match(:text("Buy"), 3)` can be used to select an element based on it's position/order.

✨ Ultimate Guide to Python 3.10 🐍 - http://bit.ly/pywizard
✨ Full Playwright Course 🎭 - https://bit.ly/playwright-auto
✨ CSS & XPath Masterclass 🔍 - https://bit.ly/css-xpath-masterclass

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.


Auf dieser Seite können Sie das Online-Video Playwright Python - CSS Selector Pseudo Classes mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Rahul Mula 11 Juli 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,019 Mal angesehen und es wurde von 10 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!