我用这个网站加载了Bing地图脚本:Bing地图不加载
<html><head>
<script src="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1" type="application/javascript" ></script>
</head><body></body></html>
在Firefox
:脚本负荷,并增加了另一个脚本标签头,那么第二个脚本负载(可以在Firebug Net标签看):
<html><head>
<script src="https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1" type="application/javascript" ></script>
<script type="text/javascript" src="https://ecn.dev.virtualearth.net/mapcontrol/v7.0/7.0.20140904153057.64/js/en-us/veapicore.js">
</head><body></body></html>
in phantomjs:我钩到page.onResourceRequested并打印请求url。结果是只有第一个脚本被请求,veapicore.js没有被请求我不知道的原因。
这里发生了什么事?
请注册到['onConsoleMessage'](http://phantomjs.org/api/webpage/handler/on -console-message.html)和['onError'](http://phantomjs.org/api/webpage/handler/on-error.html)事件。还请注册['onResourceError'](http://phantomjs.org/api/webpage/handler/on-resource-error.html)和['onResourceTimeout'](http://phantomjs.org/api/网页/处理程序/ on-resource-timeout.html)事件。也许有错误。 – 2014-10-30 23:14:31
后,我会将其标记为答案 – taminov 2014-11-02 09:13:51
谢谢我使用您的建议找到了解决方案。我之前已经使用过onError和onConsoleMessage,但是错误被隐藏在onResourceError - SSL事件中。 --ssl协议=任何。 http://stackoverflow.com/questions/12021578/phantomjs-failing-to-open-https-site%E2%80%8C%E2%80%8B – taminov 2014-11-02 09:19:00