cannot open connection: Authorization Required

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

cannot open connection: Authorization Required

Spencer Graves
Hi, All:

      Is there a way in R to access a file / web site that requires
permission?

      Consider for example the following:


 > readLines('http://www.r-project.org/', 4)
[1] "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
[2] "<html>"                                                          
[3] "<head>"                                                          
[4] "<title>The R Project for Statistical Computing</title>"  

 > readLines(URL) # URL = web address, which I can see via manual access.
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open: HTTP status was '401 Authorization Required'


      Thanks,
      Spencer Graves

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: cannot open connection: Authorization Required

Bernardo Rangel tura
Em Sex, 2008-10-03 às 11:22 -0700, Spencer Graves escreveu:

> Hi, All:
>
>       Is there a way in R to access a file / web site that requires
> permission?
>
>       Consider for example the following:
>
>
>  > readLines('http://www.r-project.org/', 4)
> [1] "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"
> [2] "<html>"                                                          
> [3] "<head>"                                                          
> [4] "<title>The R Project for Statistical Computing</title>"  
>
>  > readLines(URL) # URL = web address, which I can see via manual access.
> Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open: HTTP status was '401 Authorization Required'
>
>
>       Thanks,
>       Spencer Graves

Spencer,  this is a local problem in my system

>
> >  readLines('http://www.r-project.org/')
>  [1] "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">"      
>  [2] "<html>"                                                                  
>  [3] "<head>"                                                                  
>  [4] "<title>The R Project for Statistical Computing</title>"                  
>  [5] "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">"          
>  [6] "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">"
>  [7] "<link rel=\"stylesheet\" type=\"text/css\" href=\"R.css\">"              
>  [8] "</head>"                                                                
>  [9] ""                                                                        
> [10] "<FRAMESET cols=\"1*, 4*\" border=0>"                                    
> [11] "<FRAMESET rows=\"120, 1*\">"                                            
> [12] "<FRAME src=\"logo.html\" name=\"logo\" frameborder=0>"                  
> [13] "<FRAME src=\"navbar.html\" name=\"contents\" frameborder=0>"            
> [14] "</FRAMESET>"                                                            
> [15] "<FRAME src=\"main.shtml\" name=\"banner\" frameborder=0>"                
> [16] "<noframes>"                                                              
> [17] "<h1>The R Project for Statistical Computing</h1>"                        
> [18] ""                                                                        
> [19] "Your browser seems not to support frames,"                              
> [20] "here is the <A href=\"navbar.html\">contents page</A> of the R Project's"
> [21] "website."                                                                
> [22] "</noframes>"                                                            
> [23] "</FRAMESET>"                                                            
> [24] ""                                                                        
> [25] ""                                                                        
> [26] ""                                                                        

I run R.2.7.2 in Ubuntu AMD 64 machine


--
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.