FileChooser objects are dispatched by the page in the page.on("filechooser") event.
with page.expect_file_chooser() as fc_info:
page.click("upload")
file_chooser = fc_info.value
file_chooser.set_files("myfile.pdf")
async with page.expect_file_chooser() as fc_info:
await page.click("upload")
file_chooser = await fc_info.value
await file_chooser.set_files("myfile.pdf")
Returns input element associated with this file chooser.
file_chooser.is_multiple()#Returns whether this file chooser accepts multiple files.
file_chooser.page#Returns page this file chooser belongs to.
file_chooser.set_files(files, **kwargs)#files
<Union[str, pathlib.Path]|List[Union[str, pathlib.Path]]|Dict|List[Dict]>
no_wait_after
<bool> Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to false
.timeout
<float> Maximum time in milliseconds, defaults to 30 seconds, pass 0
to disable timeout. The default value can be changed by using the browser_context.set_default_timeout(timeout) or page.set_default_timeout(timeout) methods.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 the current working directory. For empty array, clears the selected files.
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