<div dir="ltr">Raphael, eu acho que vai ser um pouco mais complicado do que eu imaginava. Veja que no site diz que o uso de cookies deve ser autorizado no seu navegador, então, o mesmo se aplica ao R. <div>A sua melhor estratégia deve ser criando 2 funções: (1) que execute o login guardando as informações de acesso (cookie); (2) fazer o download dos dados propriamente.</div>

<div><br></div><div>Obviamente não pude testar a solução abaixo porque não sou usuário do site.</div><div><br></div><div><br></div><div style>####@ Exemplo @####<br></div><div style><br></div><div><div>#Pagina links </div>

<div>loginurl = "<a href="http://ead.portalinstitutounibanco.org.br/login/index.php">http://ead.portalinstitutounibanco.org.br/login/index.php</a>"</div><div>dataurl  = "<a href="http://ead.portalinstitutounibanco.org.br/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&id=149&user=0&date=0&modid=&modaction=0&logformat=downloadascsv">http://ead.portalinstitutounibanco.org.br/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&id=149&user=0&date=0&modid=&modaction=0&logformat=downloadascsv</a>"</div>

<div><br></div><div>#Dados da conta de acesso</div><div>pars=list(</div><div>     username="Nome de usuário",</div><div>     password="Senha",</div><div><span class="" style="white-space:pre">   </span> submitButton = "Acesso")</div>

<div><br></div><div><br></div><div>browser="Safari/5.0"</div><div><br></div><div>#pars</div><div>curl<-RCurl:::getCurlHandle()</div><div>RCurl:::curlSetOpt(cookiejar="cookies.txt", useragent=browser, followlocation=TRUE, curl=curl)</div>

<div><br></div><div>#Para fazer o login</div><div>login<-RCurl:::postForm(loginurl, .params=pars, curl=curl)</div><div><br></div><div># Baixar os dados</div><div>url<-RCurl:::getURL(dataurl, curl=curl)</div><div><br>

</div><div>dados<-download.file(url, destfile = "log2.txt"); dados</div></div><div><br></div><div style>####@ FIM @####</div><div><br></div><div style>Veja que o autor do pacote explica algo sobre como lidar com cookies aqui:</div>

<div><a href="http://www.omegahat.org/RCurl/RCurlJSS.pdf">http://www.omegahat.org/RCurl/RCurlJSS.pdf</a><br></div><div><br></div><div style>Daniel</div><div><div><div><br></div></div><div><br></div></div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">2013/6/12 Raphael Saldanha <span dir="ltr"><<a href="mailto:rfsaldanha@outlook.com" target="_blank">rfsaldanha@outlook.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">Olá Daniel,<div><br></div><div>Tentei o seguinte, já com o pacote carregado:</div><div><br></div><div><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:13.600000381469727px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;line-height:17.600000381469727px">

<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">postForm</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">(</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">'<a href="http://ead.portalinstitutounibanco.org.br/login/index.php" target="_blank">http://ead.portalinstitutounibanco.org.br/login/index.php</a>'</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
                    username </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"Nome de usuário"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
                    password </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"Senha"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
                    submitButton </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"Acesso"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
                    style </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"POST"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">)</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">


url </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"><-</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"<a href="http://ead.portalinstitutounibanco.org.br/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&id=149&user=0&date=0&modid=&modaction=0&logformat=downloadascsv" target="_blank">http://ead.portalinstitutounibanco.org.br/course/report/log/index.php?chooselog=1&showusers=1&showcourses=1&id=149&user=0&date=0&modid=&modaction=0&logformat=downloadascsv</a>"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">

download</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">.</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">file</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">(</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">url</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> destfile </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">"log2.txt"</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">)</span></code></pre>

<div class="im"><br>---<div><br></div><div>Atenciosamente,</div><div>Raphael Saldanha</div><div><br></div><div><a href="mailto:rfsaldanha@outlook.com" target="_blank">rfsaldanha@outlook.com</a></div><br><br></div><div><hr>

From: <a href="mailto:dmarcelino@live.com" target="_blank">dmarcelino@live.com</a><br>Date: Wed, 12 Jun 2013 13:39:08 -0400<br>To: <a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a><br>

Subject: Re: [R-br] RCurl<div class="im"><br><br><div dir="ltr">Você pode passar um exemplo de como você está tentando?<div><br></div><div>Daniel</div></div></div><div><div class="im"><br><br><div>2013/6/12 Raphael Saldanha <span dir="ltr"><<a href="mailto:rfsaldanha@outlook.com" target="_blank">rfsaldanha@outlook.com</a>></span><br>



<blockquote style="border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Olá pessoal,<br><br>Estou tentando usar o pacote RCurl para logar em um site (plataforma moodle) e pegar alguns relatórios de acesso, mas não estou tendo sucesso. Alguém tem experiência com este pacote?<br>



<br>---<div><br></div><div>Atenciosamente,</div><div>Raphael Saldanha</div><div><br></div><div><a href="mailto:rfsaldanha@outlook.com" target="_blank">rfsaldanha@outlook.com</a></div>                                     </div></div>
<br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>



</div><div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:10pt">\begin{signature}</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">Daniel Marcelino</span><br style="font-family:arial;font-size:small">



<span style="font-family:arial;font-size:10pt"><img title="Nuvem" alt="Nuvem"> </span><a href="mailto:dm.silva@umontreal.ca" style="font-family:arial;font-size:small" target="_blank">dm.silva@umontreal.ca</a><span style="font-family:arial;font-size:10pt"> </span><br style="font-family:arial;font-size:small">



<span style="font-family:arial;font-size:10pt"><img title="Telefone preto" alt="Telefone preto"> <a href="tel:%28514%29%20343%206111%20%233799" value="+15143436111" target="_blank">(514) 343 6111 #3799</a></span></font></div>

<div class="im"><div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:13px">Skype: d.marcelino </span></font></div>

<div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:10pt">✎ 3200 Jean Brillant,  Office C5071</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">Montreal, QC; H3T 1N8</span><br style="font-family:arial;font-size:small">



<span style="font-family:arial;font-size:10pt">Canada</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">\end{signature}</span></font></div><div style="font-family:Calibri,sans-serif;font-size:16px">



<font face="Verdana"><span style="font-family:arial;font-size:13px"><br></span></font></div><div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:13px">"Small steps toward a much better world"</span></font></div>




</div></div>
<br>_______________________________________________
R-br mailing list
<a href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne�a c�digo m�nimo reproduz�vel.</div></div>                                           </div></div>
<br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>

<div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:10pt">\begin{signature}</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">Daniel Marcelino</span><br style="font-family:arial;font-size:small">

<span style="font-family:arial;font-size:10pt">☁ </span><a href="mailto:dm.silva@umontreal.ca" style="font-family:arial;font-size:small" target="_blank">dm.silva@umontreal.ca</a><span style="font-family:arial;font-size:10pt"> </span><br style="font-family:arial;font-size:small">

<span style="font-family:arial;font-size:10pt">☎ (514) 343 6111 #3799</span></font></div><div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:13px">Skype: d.marcelino </span></font></div>

<div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:10pt">✎ 3200 Jean Brillant,  Office C5071</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">Montreal, QC; H3T 1N8</span><br style="font-family:arial;font-size:small">

<span style="font-family:arial;font-size:10pt">Canada</span><br style="font-family:arial;font-size:small"><span style="font-family:arial;font-size:10pt">\end{signature}</span></font></div><div style="font-family:Calibri,sans-serif;font-size:16px">

<font face="Verdana"><span style="font-family:arial;font-size:13px"><br></span></font></div><div style="font-family:Calibri,sans-serif;font-size:16px"><font face="Verdana"><span style="font-family:arial;font-size:13px">"Small steps toward a much better world"</span></font></div>


</div>