草庐IT

phantomjs-prebuilt

全部标签

javascript - phantomjs 不等待 "full"页面加载

我正在使用PhantomJSv1.4.1加载一些网页。我无权访问他们的服务器端,我只是获得指向他们的链接。我正在使用Phantom的过时版本,因为我需要在该网页上支持Adob​​eFlash。问题是许多网站正在异步加载他们的次要内容,这就是为什么Phantom的onLoadFinished回调(HTML中的onLoad的模拟)在并非所有内容都已加载时过早触发的原因。任何人都可以建议我如何等待网页完全加载,例如制作包含所有动态内容(如广告)的屏幕截图? 最佳答案 另一种方法是让PhantomJS在页面加载后稍等片刻,然后再进行渲染,按

go - 将完整代码传递给 phantomjs

我正在用Go编写服务,我正在使用phantomJS从给定的url生成图像。在我的Go程序中,我使用Exec来启动phantomJS二进制文件。这工作正常,但现在我正在寻找一种方法来传递完整的代码,以及运行二进制文件的调用。我的代码如下:varargs=require('system').args;varwebPage=require('webpage');varpage=webPage.create();page.viewportSize={width:1920,height:1080};page.open("http://www.url2fetch.com",function(sta

node.js - Karma PhantomJs - Linux 和 Win 7 上的 TypeError 所有测试都成功

我正在运行命令npminstallkarmakarma-jasminekarma-phantomjs-launcherphantomjs@2.1.7jasmine-core--save-devkarmastart在我的LinuxCentOs7.2机器上得到这个错误:bower_components/angular/angular.js:4641:53forEach@bower_components/angular/angular.js:321:24loadModules@bower_components/angular/angular.js:4601:12createInjector@

linux - Phantomjs - 没有这样的文件或目录(我错过了什么)

在共享主机服务器上设置phantomjs需要一些帮助吗?让我回顾一下我所做的,然后提出我的问题。采取的步骤...使用“Putty”来检查我的服务器的架构,就像这样……uname–m//x86_64cat/etc/issue//DebianGNU/Linux6.0\n\l我从这个页面https://bitbucket.org/ariya/phantomjs/downloads下载了64位版本的‘phantomjs-1.9.8-linux-x86_64.tar.bz2’将该文件放在我服务器上的一个文件夹中,然后在Putty中运行下一个命令......tar-jxvfphantomjs-1.

python - 使用 python 和 selenium 连接到 phantomJs webdriver 时遇到问题

我正在尝试在使用selenium和phantomjswebdriver的linux服务器上运行python脚本;但是,我不断收到以下错误消息:selenium.common.exceptions.WebDriverException:Message:Service/home/ubuntu/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjsunexpectedlyexited.Statuscodewas:127这是一个简单的测试脚本,它会失败并生成此错误:importseleniumfromseleniumimportweb

python - 使用 PhantomJS 的 Selenium 内存使用失控

我用Python编写了一个脚本,它遍历一长串网页并收集数据,使用Selenium和PhantomJS作为webdriver(因为我在运行Linux的远程终端机器上运行它,并且需要使用headless浏览器)。对于短期工作,例如它必须迭代几页,没有问题。但是,对于较长的作业,它必须遍历更长的页面列表,每次加载新页面时,我都会看到内存使用量随着时间的推移急剧增加。最终在大约20个奇数页之后,脚本由于内存溢出而被终止。这是我初始化浏览器的方式-fromseleniumimportwebdriverurl='http://someurl.com/'browser=webdriver.Phant

python - Selenium Python Headless Webdriver (PhantomJS) 不工作

所以我无法让selenium与headless驱动程序一起工作,特别是PhantomJS。我正在尝试让它在Ubuntu网络服务器(Ubuntu14.04.2LTS)上运行。从python解释器(Python2.7.6)运行以下命令给出:fromseleniumimportwebdriverdriver=webdriver.PhantomJS()Traceback(mostrecentcalllast):File"",line1,inFile"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/phantomjs/webdr

javascript - 如何从 PHP 执行 PhantomJS

我想在本地主机上从PHP执行PhantomJS。谁能解释如何从PHP执行PhantomJS以及我应该从phantomjs.org下载什么包? 最佳答案 下载PhantomJSbinary,将其上传到某处并使其可执行(chmod+x)如果你要截屏,设置fontconfig(这对我的配置来说非常具体,但目标是确保您的系统上至少有一些字体)在PHP中运行以下命令:$response=exec('/path/to/phantomjsmyscript.js'); 关于javascript-如何从P

php - PhantomJS 挂了很长时间说 "Asynchronous Sessions clean-up phase starting NOW"

这是截图:task:CodeceptionPHPTestingFrameworkv1.6.2PoweredbyPHPUnit3.7.19bySebastianBergmann.Suiteselenium_acceptancestartedTryingtoseethewelcomepageofnewweather(welcomeCept.php)issue:itsitsasitisandwaitingforphantomJStorespondandbelowiswhatphantomJSscreenisshowing:[INFO-2014-03-13T01:42:51.575Z]Sess

jquery - 如何在 phantomJS 中执行 jQuery promise ?

我正在尝试在服务器端使用nodejs和phantomjs来进行我们网站的SEO。虽然ajax工作正常,但我无法执行我在代码中使用的自定义promise。我如何让phantomJS等到promise得到解决。以下是我编码的内容。$('body').addClass('before-dom-ready');$(function(){$('body').addClass('after-dom-ready');vardfrd=$.Deferred(),promise=dfrd.promise();setTimeout(function(){dfrd.resolve();},5000);prom