Copied here :
I need to save files from websites using HtmlUnit . I am currently browsing pages with several anchors using javascript:
onClick()="DownloadAttachment('attachmentId')"
So far I have not been able to find resources or examples showing how to save files using HtmlUnit. I mainly tried to get an AttachmentHandler to work for this, since it most likely works, but was unsuccessful.
How to use AttachmentHandler to get the data stream that the browser will see if I click the link?
Aaron digulla
source share