【发布时间】:2021-11-30 16:47:17
【问题描述】:
我正在尝试编写一组 R 代码来从受密码保护的网站截取屏幕截图。
我曾尝试使用 webshot 和 httr 软件包,但无法找到解决方案。
以下是我尝试过的代码。
library(httr)
library(webshot)
handle <- handle("url of the home page")
path <- "url of login page"
login <- list(username = "my username", password = "my password", redirect_url = "url of the page that I want to screenshot")
response <- POST(handle = handle, path = path, body = login)
webshot("url of the page that I want to screenshot", "screenshot.png")
截图显示的是登录页面,而不是我要截图的页面。这意味着在截屏之前该网站尚未登录。谁能帮帮我?
【问题讨论】:
-
当问题似乎是寻求帮助以解决违反 TOS 或破坏版权或访问专有数据的问题时,通常会犹豫。
标签: r password-protection httr webpage-screenshot