> library(rvest)
> library(pipeR)
> lnk <- 'http://www.sbobetonline.com/euro/football'
> lnk %>>% html_session %>% .$response %>% .$headers
> lnk %>>% html_session %>% .$response %>% .$cookies
> web <- lnk %>>% html_session
user <- lnk %>>% html_session %>>% html_node(xpath='//*[@id="username"]') %>>% set_values(., 'username'="xxxxxxx") #用户名 xxxxxxx
pass <- lnk %>>% html_session %>>% html_node(xpath='//*[@id="username"]') %>>% set_values(., 'password'="xxxxxxx") #密码 xxxxxxx
submit_form(web, user, pass)
#'@ domain=.sbobetonline.com
#'@ ASP.NET_SessionId=jx0jswds3w3jsoo0awxc4kyd
#'@ lnk2 %>>% getURL(., cookies='jx0jswds3w3jsoo0awxc4kyd; domain=.sbobetonline.com')
#'@ getURL(lnk2, cookie='jx0jswds3w3jsoo0awxc4kyd; domain=.sbobetonline.com')
怎么登入网站账户?
http://stackoverflow.com/questions/27631460/how-can-i-post-a-simple-html-form-in-r