chromote icon indicating copy to clipboard operation
chromote copied to clipboard

Documenting setting browser options, especially downloads

Open noamross opened this issue 9 months ago • 2 comments

It would be extremely helpful to have some discoverable documentation of setting common browser options. The Chrome DevTools protocol is really opaque, especially for the data scientist/web scraper trying to accomplish a few tasks. One that I remember hunting down forever was figuring how to download a file from a page in a web scraping session, should the file be non displayable in the browser or triggered as an off-page event. In this case, the browser needs to be set to not pop up a dialogue to confirm the download, and the download location may or not be the user's 'Downloads' folder. Putting this and a few similar things in a vignette for common automation tasks will probably be of great help to users!

  chromote_session$Browser$setDownloadBehavior(
    behavior = "allow",
    downloadPath = tmp_download_dir
  )

noamross avatar Mar 26 '25 02:03 noamross

That's a great idea @noamross and we recently added a section in the site for examples, see https://rstudio.github.io/chromote/articles and e.g. https://rstudio.github.io/chromote/articles/example-loading-page.html. Would you be interested in contributing a PR for how to set this download option?

gadenbuie avatar Mar 26 '25 12:03 gadenbuie

Yes, happy to.

noamross avatar Mar 26 '25 13:03 noamross