R httr POST request for signing in -
I am trying to log in to bondora.com using R besrombore request because this site is used Not being authenticated:
Library (optimizer) login & lt; - "https://www.bondora.com/en/login" page & lt; - List (user name = "MyUserName", password = "), the website directs the user back to the landing page bondora.com/en/home, but instead if I parsed the post request I page The same title comes from the login page for: Library exam (xml) & lt; - POST (log in, body = purse) test & lt; - content (test, like That = "text") parseed HTML & lt; - html mercury (test, asText = TRUE) xpathSApply (Perceived HTML, "// Title", xmlValue) [1] "Join or Log In | Loan and Investment | Bondora" I have the same technique on some other sites And the output of the POST command shown to work fine enough to leave this site as follows:
Post (login, body = purse) response [https: / /www.bondora.com/en/login] Status: 200 Content-Type: Text / html; Charset = UTF-8 & lt ;! DOCTYPE HTML & gt; & gt; HTML xmlns = "http: //www.w3 .org / 1999 / xhtml "& gt; ... What are some special settings that I should use to log on bondora.com/en/login? According to the comment, UPDATE 1 @Hadley commented, I was tired of TRUL and FALSE sets, but no help. Then I inspected the request through the browser and added the same header : Login & lt; - "https://www.bondora.com/en/authenticate" pars & lt; - list (username = "username", password = "password") header & lt; - List ("User-agent" = "Mozilla / 5.0 (X11; Ubuntu; Linux x86_64; rv: 28.0) Gecko / 20100101 Firefox / 28.0", "Referrers" = "https://www.bondora.com/en/ login "returnurl = / en / home", "host" = "www.bondora.com", "connection" = "keep-alive", "accept-language" = "N-US, N = Q = 0.5", Error in 'character-encoding' = "gzip, diffleet", "accept" = "text / html, app / xhtml + xml, app / xml; q = 0.9; * / character (header): invalid 'length' argument < / code> this (*; q = 0.8 ") POST (login, body = pars, add_headers ( .headers = character (headers)) It seems that I will need to specify the length argument as the HTML error 411 signal. How do I do? I want to add the request header to content-length = 9844 Try it because it was in the answer header, but no success.
I find it helpfulr_0.4 Was able to solve it by updating to httr_0.5
Comments
Post a Comment