MCPcopy Index your code
hub / github.com/microsoft/playwright-python / input_value

Method input_value

playwright/async_api/_generated.py:12084–12120  ·  view source on GitHub ↗

Page.input_value Returns `input.value` for the selected ` ` or ` ` or ` ` element. Throws for non-input elements. However, if the element is inside the ` ` element that has an associated [control](https://developer.mozilla.org/en-US/docs/Web/API/

(
        self,
        selector: str,
        *,
        strict: typing.Optional[bool] = None,
        timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
    )

Source from the content-addressed store, hash-verified

12082 )
12083
12084 async def input_value(
12085 self,
12086 selector: str,
12087 *,
12088 strict: typing.Optional[bool] = None,
12089 timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
12090 ) -> str:
12091 """Page.input_value
12092
12093 Returns `input.value` for the selected `<input>` or `<textarea>` or `<select>` element.
12094
12095 Throws for non-input elements. However, if the element is inside the `<label>` element that has an associated
12096 [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), returns the value of the
12097 control.
12098
12099 Parameters
12100 ----------
12101 selector : str
12102 A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
12103 used.
12104 strict : Union[bool, None]
12105 When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
12106 element, the call throws an exception.
12107 timeout : Union[float, None]
12108 Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can
12109 be changed by using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.
12110
12111 Returns
12112 -------
12113 str
12114 """
12115
12116 return mapping.from_maybe_impl(
12117 await self._impl_obj.input_value(
12118 selector=selector, strict=strict, timeout=to_milliseconds(timeout)
12119 )
12120 )
12121
12122 async def set_input_files(
12123 self,

Callers 3

input_valueMethod · 0.45
input_valueMethod · 0.45
input_valueMethod · 0.45

Calls 2

to_millisecondsFunction · 0.90
from_maybe_implMethod · 0.80

Tested by

no test coverage detected