Phantomjs CasperJS没有';单击后无法更新页面
在将casperJS更新到最新版本后,我遇到了一个问题Phantomjs CasperJS没有';单击后无法更新页面,phantomjs,casperjs,Phantomjs,Casperjs,在将casperJS更新到最新版本后,我遇到了一个问题 this.clickLabel('Add a link...', 'span'); this.sendKeys('input[id="newLinkSourceUrl"]', "http://google.com", {keepFocus: true, reset: true}); this.clickLabel('Shrink', 'span'); this.wait(30000, function() {
this.clickLabel('Add a link...', 'span');
this.sendKeys('input[id="newLinkSourceUrl"]', "http://google.com", {keepFocus: true, reset: true});
this.clickLabel('Shrink', 'span');
this.wait(30000, function() {
this.capture('n1.png');
});
这过去工作正常,但现在点击“收缩”后,页面即使等待很长时间也不会更新。我正在附上我得到的结果。
您使用哪个PhantomJS版本?请注册到
resource.error
,page.error
,remote.message
和casper.page.onResourceTimeout
事件()。可能有错误。我目前正在使用2.1.1 PhantomJS版本。我刚刚注册了这些事件,您是对的,有一个资源错误。ResourceError:{“errorCode”:5,“errorString”:“操作已取消”,“id”:168,“状态”:null,“状态文本”:null,“url”:“”}您可以尝试使用casperjs运行它--忽略ssl errors=true script.js
但它返回的结果完全相同。我使用的是phantomjs和casperjs的最新版本,也许我应该尝试降级其中一个?这几乎肯定是phantomjs的问题,但我怀疑降级能否解决它。您可以按该顺序尝试1.9.8、1.9.7和2.0.1/2.0.0。