RSelenium Open Method失败,错误10061

时间:2015-02-24 05:56:49

标签: r

我正试图让RSelenium第一次工作。这是我的代码:

library(RSelenium)
checkForServer()
RSelenium::startServer()
remDr <- remoteDriver()
startServer()
remDr$open()

返回文本(在open方法之后)是:

[1] "Connecting to remote server"
[[1]]
[1] "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n<head>\r\n \r\n<title>Error Message</title>\r\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\r\n\r\n<style>\r\nbody {\r\n\t\r\n\tbackground:#e5eaf5 url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/bg.gif) top left repeat-x ;\r\n\tmargin:0px 0px 0px 0px;\r\n\tfont-family:Arial, Helvetica, sans-serif;\r\n\tmin-width:1000px;\r\n\tfont-size:12px;\r\n\tcolor:#000000;\r\n\tdirection:ltr;\r\n\t}\r\nimg {border:none}\r\n\r\n\r\n\t.main {\r\n\t\twidth:100%;\r\n\t\tbackground:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/topright.gif) top right no-repeat;\r\n\t\tmin-width:1000px;\r\n\t\tmin-height:400px;\r\n\t\tmargin-left:auto;\r\n\t\tmargin-right:auto;\r\n\t\ttext-align:left;\r\n\t}\r\n\t\r\n\t.logo {float:left;  height:103px; }\r\n\t.sidetext {float:right; width:182px; height:52px; background:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/sidetext.png) top left; border:1px solid #2a2e31; margin-right:20px; margin-top:20px; padding:4px; }\r\n\t.sidetextNone {visibility:hidden; }\r\n\t\r\n\t.whiteline {float:left; clear:both; font-size:20px; margin-left:47px; margin-top:17px; color:#ffffff; white-space:nowrap; }\r\n\t.bold {font-weight:bold;}\r\n\t\r\n\t.maintext {float:left; margin-top:20px; clear:both; color:#000; margin-left:47px;}\r\n\t\r\n\t.color1 {color:#677183;}\r\n\t\r\n\tul {margin-top:0; padding-left:15px; padding-top:5px; padding-bottom:5px;}\r\n\t\r\n\tul li {list-style-image:url(/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/bullet.gif)}\r\n\tA {\r\n    FONT-WEIGHT: bold; COLOR: #005a80;\r\n}\r\nA:hover {\r\n    FONT-WEIGHT: bold;COLOR: #0d3372;\r\n}\r\n</style>\r\n  \r\n</head>\r\n<body>\r\n\t<div class=\"main\">\r\n        <div class=\"logo\"><img src=\"/Wbo-FD9B7ED9-215B-4626-9B9E-D453142D7B18/logo.png\" alt=\"ForeFront\" /></div>\r\n        <div class=\"whiteline\"><td id=L_10061_2><span class=\"bold\">Network Access Message:</span> The page cannot be displayed </td></div>\r\n    <div class=\"maintext\">\r\n    <td id=L_10061_3><span class=\"bold color1\">Explanation:</span> The Web server refused the connection.  </td><br />\r\n<br />\r\n\r\n<td id=L_10061_5><span class=\"bold color1\">Try the following:</span></td><br />\r\n\r\n<ul>\r\n<li><td id=L_10061_6><span class=\"bold\">Refresh page:</span> Search for the page again by clicking the Refresh button. The timeout could have occurred due to Internet congestion.   </td></li>\r\n<li><td id=L_10061_7><span class=\"bold\">Check spelling:</span> Check that the Web page address is spelled correctly. The address may have been mistyped.</td></li>\r\n<li><td id=L_10061_8><span class=\"bold\">Access from a link:</span> If there is a link to the page you are looking for, try accessing the page from that link. </td></li>\r\n<li><td id=L_10061_9><span class=\"bold\">Contact website:</span>You may want to contact the website administrator to make sure the Web page still exists. You can do this by using the e-mail address or phone number listed on the website home page.</td></li>\r\n</ul>\r\n<br />\r\n\r\n<td id=L_10061_10><span>If you are still not able to view the requested page, try contacting your administrator or Helpdesk.</span></td> <br />\r\n\r\n<br />\r\n<td id=L_10061_11><span class=\"bold color1\">Technical Information (for support personnel)</span></td><br />\r\n<ul>\r\n<li><td id=L_10061_12><span class=\"bold\">Error Code 10061:</span> Connection refused</td></li>\r\n<li><td id=L_10061_13><span class=\"bold\">Background:</span>The server you are attempting to access has refused the connection with the gateway. This usually results from trying to connect to a service that is inactive on the server.</td></li>\r\n<li><td id=L_10061_14><span class=\"bold\">Date:</span></td> 24/02/2015 3:45:09 AM [GMT]</li>\r\n<li><td id=L_10061_15><span class=\"bold\">Server:</span></td> MELDVTMG1.oceania.cshare.net </li>\r\n<li><td id=L_10061_16><span class=\"bold\">Source:</span> Remote server </td></li>\r\n</ul>\r\n    </div>\r\n</div>\r\n</body>\r\n</html>\r\n"

提取我收集的一些相关文本

  • 发生错误编号10061,并附带相关文字:
  • 您尝试访问的服务器拒绝与网关建立连接。这通常是因为尝试连接到服务器上不活动的服务
  • 有问题的服务器是MELDVTMG1.oceania.cshare.net

这是我组织中的服务器。我在防火墙后面运行,使用代理,但据我所知,Selenium不需要通过防火墙,它就是浏览器。我希望我说得对。

我用谷歌搜索'rselenium open method 10061'和各种组合,没有运气。

我也尝试过将phantomjs与代码一起使用:

require(RSelenium)
pJS <- phantom()
Sys.sleep(5) # give the binary a moment
remDr <- remoteDriver(browserName = 'phantomjs')
remDr$open()

我收到了相同的错误文字。但是,如果我使用phantomjs test.js之类的命令直接从命令行运行phantomjs,其中test.js文件为:

var page = require('webpage').create();
page.open('http://www.news.com.au/', function(status) {
  console.log("Status: " + status);
  if(status === "success") {
    page.render('example.png');
    console.log('http://www.news.com.au/');
  }
  phantom.exit();
});

...然后它返回'成功',以及网站的快照,这表明它可以通过防火墙,这不是问题。

我错过了一些明显的东西吗?我们将非常感激地收到任何指示。

我想我应该说为什么我会尝试使用RSelenium,以防有更好的方法。基本上我想去一个网页,填写一些下拉菜单并按下一个按钮,导致文件被下载。

安装的版本是:

  • phantomjs v2.0
  • RSelenium v​​1.0
  • RStudio v0.98.1083
  • R v3.1.1(64位)
  • Windows 7(64位)

0 个答案:

没有答案