You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**ProTip™:** In most web browsers, you can right-click on a page and select ``Inspect Element`` to see the CSS selector details that you'll need to create your own scripts.
988
988
989
-
🔵 Typing Text:
989
+
🔵 **Typing Text:**
990
990
991
991
<code>self.type(selector, text)</code># updates the text from the specified element with the specified value. An exception is raised if the element is missing or if the text field is not editable. Example:
You can also use <code>self.add_text()</code> or the <a href="https://www.selenium.dev/documentation/webdriver/" target="_blank">WebDriver</a><code>.send_keys()</code> command, but those won't clear the text box first if there's already text inside.
998
998
999
-
🔵 Getting the text from an element on a page:
999
+
🔵 **Getting the text from an element on a page:**
1000
1000
1001
1001
```python
1002
1002
text = self.get_text("header h2")
1003
1003
```
1004
1004
1005
-
🔵 Getting the attribute value from an element on a page:
1005
+
🔵 **Getting the attribute value from an element on a page:**
(NOTE: ``self.find_text(TEXT, ELEMENT)`` and ``self.wait_for_text(TEXT, ELEMENT)`` also do this. For backwards compatibility, older method names were kept, but the default timeout may be different.)
0 commit comments