Enter键不会与splashR :: splash_send_key一起发送

问题描述

编辑:由于我无法编辑赏金信息:“我没有Lua的专家来自行解决此问题。希望有人可以帮助我。”

使用以下代码段,我想使用splashR自动将自己登录到我的strava.com帐户中。可悲的是,似乎输入按钮将不会发送到站点公式字段以发送登录凭据。我也尝试将鼠标单击发送到登录按钮。有人知道这样做的窍门吗?

library(splashr)    
splash_local %>%
splash_go(url ='https://www.strava.com/login') %>%
splash_focus("#email") %>%
splash_send_text('username') %>%
splash_focus("#password") %>%
splash_send_text("password") %>%
splash_focus("#password") %>%
splash_send_keys('enter') %>%
#splash_click(x = 550,y = 567) %>%
   splash_png()

编辑:按照@ roger-123的要求,用'enter'替换'<enter>'会引发以下错误Error in execute_lua(splash_obj,call_function) : Bad Request (HTTP 400).

解决方法

尝试将'enter'替换为'<enter>',看看是否可行。括号中的单词代表功能键。

这是QT使用的密钥名称的列表

https://doc.qt.io/qt-5/qt.html#Key-enum

,

尝试使用“”而不是“”或“enter”。