-
Notifications
You must be signed in to change notification settings - Fork 2
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
How to download files with Selenider #30
Comments
If your selenider session is named
|
thanks let me see if this works! |
thanks! working great. I wonder if this would be worth adding to your documentation, and not just for the downloading part, but for passing options to chromote? |
I'm working on a new vignette that would go through this (#34). |
Unfortunately, it does not work for me with this website: "https://www-genesis.destatis.de/datenbank/online/statistic/43331/table/43331-0001#modal=table-download¶ms=JTVCJTdCJTIycGFyYW1zJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlN0QlNUQ=" -> I want to download the .xlsx file by clicking the XLSX button. My code:
The only thing that happens, is that an empty folder named "data.xlsx" will be saved in "C:/Users/a.name/downloads/". Is there any solution to this? I would be really interested if anyone is able to download this file with selenider in R (chromote). The website was just recently launched by the German federal Statistical Office. I would be very glad for help. Thank you! |
This works for me: library(selenider)
session <- selenider_session(timeout = 10)
session$driver$Browser$setDownloadBehavior(behavior = "allow", downloadPath = ".test")
open_url("https://www-genesis.destatis.de/datenbank/online/statistic/47414/table/47414-0005#modal=table-download¶ms=JTVCJTdCJTIycGFyYW1zJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlN0QlNUQ=")
s(".button-button.statistic-table-download-modal-overlay-button[title='XLSX Format']") |>
elem_click()
# Wait for the file to be downloaded
Sys.sleep(10) |
HI, I have a question.
In the process of webscrapping I need chromote to download files when clicking a css element on screen. The click works, but the default chromote session opened by selenider does not support downloading files. In chromote it is possible to set such an option with :
b$Browser$setDownloadBehavior(behavior = "allow", downloadPath = "<path_to_folder>")
But there does not seem to be a way to pass such settings through the chromote_options() function. Is this something that can be added, or is there a different way to achieve this in selenider?
The text was updated successfully, but these errors were encountered: