Support authenticated sites
blairj09 opened this issue · comments
webshot()
should support screenshots of authenticated sites. A potential workflow could follow the pattern of token_fetch()
from the gargle package:
webshot("auth.website.url")
detects that there’s an authentication layer in place (not sure if this is possible, but most auth sites will redirect to a login page if credentials are missing, so maybe check for that re-direct)- Offers to cache cookies
- Opens a browser for the user to perform sign-in
- Captures and optionally caches cookies
- Continues on with capturing the screenshot
It may also be helpful to provide a cookies
argument to webshot()
so that authenticated sites can be accessed programmatically.
I miss the eval
argument that webshot::webshot()
has (and that I used to authenticate).
@maelle Can you file a new issue about eval
?
Is there a way to use webshot with pages that require authentication now?
Just noting that you can do screenshots with chromote https://github.com/rstudio/chromote whose interface lets you perform actions on the page more easily.
Thanks @maelle. I had not heard about chromote. Great tool.