phantombuster / nickjs

Web scraping library made by the Phantombuster team. Modern, simple & works on all websites. (Deprecated)
https://nickjs.org
ISC License
500 stars 48 forks source link

Can't download from sites #42

Closed drdeaton closed 6 years ago

drdeaton commented 6 years ago

What I've tried

Reinstalling Chrome Modifying my installation of Nickjs to try enabling downloads *Reinstalling a clean Nickjs installation

Expected behavior

Downloadable files will be downloaded when navigated to

Actual behavior

Downloadable files are not downloaded

paps commented 6 years ago

Interesting, I guess Chrome doesn't download files by itself when it is drived by the DevTools protocol?

Can you give a minimal code sample that triggers the problem please?

Since you're in a Node environment, you can bypass this problem by making an HTTP request yourself (with a module like request) instead of navigating to the page.

drdeaton commented 6 years ago

A few hours after posting, I managed to bypass the problem by directly accessing the driver and using setDownloadBehavior. The code I used is:

tab.driver.client.Page.setDownloadBehavior({"behavior":"allow", "downloadPath":"<Download path>"})