-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Mention HTML unit in file downloads section #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@skyhirider, would you like to send us a pull request with that suggestion? |
@diemol I can, but saw there are several language files in the repo. Presume English is good enough? Any guidelines on what to write and how? |
described attachment download option via HtmlUnit
@skyhirider please for all languages, check step 3 of this contribution guide |
* closes #533 described attachment download option via HtmlUnit * added untranslated text to all other languages * Update docs_source_files/content/worst_practices/file_downloads.es.md * Update docs_source_files/content/worst_practices/file_downloads.fr.md * Update docs_source_files/content/worst_practices/file_downloads.ja.md * Update docs_source_files/content/worst_practices/file_downloads.ko.md * Update docs_source_files/content/worst_practices/file_downloads.nl.md * Update docs_source_files/content/worst_practices/file_downloads.zh-cn.md Co-authored-by: Diego Molina <[email protected]>
* closes #533 described attachment download option via HtmlUnit * added untranslated text to all other languages * Update docs_source_files/content/worst_practices/file_downloads.es.md * Update docs_source_files/content/worst_practices/file_downloads.fr.md * Update docs_source_files/content/worst_practices/file_downloads.ja.md * Update docs_source_files/content/worst_practices/file_downloads.ko.md * Update docs_source_files/content/worst_practices/file_downloads.nl.md * Update docs_source_files/content/worst_practices/file_downloads.zh-cn.md Co-authored-by: Diego Molina <[email protected]> caead29
🚀 Feature Proposal for the site or the documentation
https://www.selenium.dev/documentation/en/worst_practices/file_downloads/
HTMLunit has a mature interface for file downloads ( see https://htmlunit.sourceforge.io/apidocs/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.html )
It could be mentioned as many are looking to use Selenium for web scraping and file downloads and copying a link is not always possible, especially with more complex JavaScript sites.
Not sure if there is a better way to handle file downloads via Selenium currently that to use HTMLunit, it's driver and native input streams
Motivation
Took me quite a bit of time to figure out how to download files. Having at least a mention in the official docs would probably hell others save time.
Example
HtmlUnit and its driver can be used to intercept files as input streams and add custom logic that will handle and save them.
See https://github.com/SeleniumHQ/htmlunit-driver and https://github.com/HtmlUnit/htmlunit/blob/master/src/main/java/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.java
The text was updated successfully, but these errors were encountered: