Coursera 上面的课程示例
con = url("http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en")
htmlCode = readLines(con)
close(con)
htmlCode
得到这个错误信息
Error in readLines(con) :
cannot open the connection to 'http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en'
此外: Warning message:
In readLines(con) :
URL 'http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en': Timeout of 60 seconds was reached
用download.file 也不行
> download.file("http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en",destfile = "xxx.xml")
试开URL’http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en'
Error in download.file("http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en", :
无法打开URL'http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en'
此外: Warning message:
In download.file("http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en",
URL 'http://scholar.google.com/citations?user=HI-I6C0AAAAJShl=en': Timeout of 60 seconds was reached
我觉得应该是代理的问题,因为url是google的,我有梯子,可以在浏览器里顺利打开url 但是不知道为什么在R里不起作用,