A&C
Apify & Crawlee
S
Apify & Crawlee
•
2y ago
safe-amethyst
submit files
title
, is there a straightforward way to submit files to a button that would trigger a file dialog
?
Apify & Crawlee
Join
This is the official developer community of Apify and Crawlee.
13,249
Members
View on Discord
Was this page helpful?
Yes
No
L
Lukas Celnar
•
5/31/24, 9:43 AM
Hi
, thanks for asking
!
It depends if you are using playwright or puppeteer
, but it should be pretty similar
.
Playwright
https://playwright.dev/docs/api/class-filechooser
Puppeteer
https://pptr.dev/api/puppeteer.page.waitforfilechooser
There is also this apify blog about uploading with puppeteer
, you might also find some additional info here
https://blog.apify.com/how-to-download-and-upload-files-in-puppeteer/#:~:text=Uploading%20files%20with%20Puppeteer,-To%20perform%20an&text=uploadFile(...,with%20the%20file%20input%20element
.
FileChooser | Playwright
FileChooser
] objects are dispatched by the page in the
[page
.on
(
'filechooser
'
) event
.
Page.waitForFileChooser() method | Puppeteer
This method is typically coupled with an action that triggers file choosing
.
Apify Blog
How to download and upload files in Puppeteer
Learn to automate file downloads and uploads with Node
.js