rcurl - Login to .NET site using R -
i trying login credentials .net site unable working. code inspired below thread
how login , download file aspx web pages r
library(rcurl) curl = getcurlhandle() curlsetopt(cookiejar = 'cookies.txt', followlocation = true, autoreferer = true, curl = curl) html <- geturl('http://www.aceanalyser.com/login.aspx', curl = curl) viewstate <- as.character(sub('.*id="__viewstate" value="([0-9a-za-z+/=]*).*', '\\1', html)) viewstategenerator <- as.character(sub('.*id="__viewstategenerator" value="([0-9a-za-z+/=]*).*', '\\1', html)) params <- list( 'txtuserid' = '********', 'txtpwd' = '*******', 'btn_login' = 'go', '__viewstate' = viewstate, '__viewstategenerator' = viewstategenerator, 'hiddenfield1' = '1280', 'hiddenfield2' = '700', 'hdn_pwd' = 'true') html = postform('http://www.aceanalyser.com/login.aspx', .params = params, curl = curl) grepl('logout', html) result: false
please me understand issue
you may change option 'btn_login' = 'go' like
'btn_login.x' = '22', 'btn_login.y' = '14' according this, reason bug.
some browsers (iirc versions of internet explorer) send co-ordinates of image map (in name.x , name.y) , ignore value.
Comments
Post a Comment