'Enter' key won't be send with splashR::splash_send_key

280 Views Asked by At

EDIT: Since I can't edit the bounty message : "I do not have the exerpertise in Lua to fix this problem on my own. I hope someone can help me with that."

With the following code snippet I want to automatically log myself into my strava.com account using splashR. Sadly, it seems that the enter button won't be sended to the site formular field to send the login credentials. I tried to send a mouse click to the log-in button aswell. Does anyone know the trick to do this?

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()

EDIT : Replacing 'enter' with '<enter>', as @roger-123 requested, throws the following error : Error in execute_lua(splash_obj, call_function) : Bad Request (HTTP 400).

2

There are 2 best solutions below

1
Roger-123 On

Try replacing 'enter' with '<enter>' and see if that works. Words within brackets represent function keys.

Here's a list of the key names used by QT

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

0
puffin On

Try with '<Return>' instead of '<enter>' or 'enter'.