FileChooser objects are dispatched by the page in the page.on("filechooser") event.
with page.expect_file_chooser() as fc_info:
page.get_by_text("Upload file").click()
file_chooser = fc_info.value
file_chooser.set_files("myfile.pdf")
async with page.expect_file_chooser() as fc_info:
await page.get_by_text("Upload file").click()
file_chooser = await fc_info.value
await file_chooser.set_files("myfile.pdf")
Methods set_filesAdded before v1.9 fileChooser.set_files
Sets the value of the file input this chooser is associated with. If some of the filePaths
are relative paths, then they are resolved relative to the current working directory. For empty array, clears the selected files.
Usage
file_chooser.set_files(files)
file_chooser.set_files(files, **kwargs)
Arguments
files
Union[str, pathlib.Path] | List[Union[str, pathlib.Path]] | Dict | List[Dict]#
no_wait_after
bool (optional)#
Deprecated
This option has no effect.
This option has no effect.
Maximum time in milliseconds. Defaults to 30000
(30 seconds). Pass 0
to disable timeout. The default value can be changed by using the browser_context.set_default_timeout() or page.set_default_timeout() methods.
Returns
Properties elementAdded before v1.9 fileChooser.elementReturns input element associated with this file chooser.
Usage
Returns
is_multipleAdded before v1.9 fileChooser.is_multipleReturns whether this file chooser accepts multiple files.
Usage
file_chooser.is_multiple()
Returns
pageAdded before v1.9 fileChooser.pageReturns page this file chooser belongs to.
Usage
Returns
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4