phantomjs

PhantomJS sometimes gives “parse error” messages

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Our company wants to start triggering our QUnit unit tests through our CI server and are looking at PhantomJS as a means of achieving this goal. We started by just trying to open a couple of our QUnit test pages in phantom via the following script: var page = require ( 'webpage' ). create (); var args = require ( 'system' ). args ; page . onConsoleMessage = function ( msg , lineNum , sourceId ) { console . log ( 'CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")' ); }; page . onError = function ( msg , trace )

How to update phantomjs 1.9.8 to phantomjs 2.1.1 on ubuntu?

旧巷老猫 提交于 2019-12-03 07:22:42
问题 I cant reinstall phantomjs 1.9.8 to 2.1.1 version on my ubuntu 16.04 Please help. 1.9.8 give me an errors when I write a spin functions, in documentation see that this ploblem I can solve with reinstalation. 回答1: I just installed phantomjs 2.1.1 in ubuntu 16.04 with the following steps, which I found after a bit of googling : sudo apt-get install nodejs sudo apt-get install nodejs-legacy sudo apt-get install npm sudo npm -g install phantomjs-prebuilt 回答2: So, jmunsch's answer works for me,

Error registering PhantomJS node in Selenium Grid

孤者浪人 提交于 2019-12-03 07:17:53
I have the following problem I successfully launched Selenium Grid hub with: java -jar selenium-server-standalone-2.53.0.jar -role hub After that I tried to launch PhantomJS node with: phantomjs --webdriver=8090 --webdriver-selenium-grid-hub=http://localhost:4444 but got Error: [INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main - running on port 8090 [INFO - 2016-03-25T13:56:28.397Z] GhostDriver - Main - registering to Selenium HUB ' http://localhost:4444 ' version: using '127.0.0.1:8090' with org.openqa.grid.selenium.proxy.DefaultRemoteProxy as remote proxy. [ERROR - 2016-03-25T13:56:28

How to get around memory error with karma & phantomjs

泪湿孤枕 提交于 2019-12-03 06:54:03
问题 We're running tests using karma and phantomjs Last week, our tests mysteriously started crashing phantomJS with an error of -1073741819. Based on this thread for Chutzpah it appears that code indicates a native memory failure with PhantomJS. Upon further investigation, we are consistently seeing phantom crash around 750MB of memory. Is there a way to configure Karma so that it does not run up against this limit? Or a way to tell it to flush phantom? We only have around 1200 tests so far. We

wait for angular app to be fully rendered from phantom script

允我心安 提交于 2019-12-03 06:47:16
I'm writing a script which generates png images from every page of my frontend. I'm using angular for the UI and capturing the pages with phantom. The view take a while until angular finish rendering it so I have to wait a little before capturing: var page = require('webpage').create(); page.open('http://localhost:9000/', function () { window.setTimeout(function () { page.render('snapshot.png'); phantom.exit(); }, 2000); }); I wonder if there is a better way to achieve this. I found angular can emit an event when the page is fully rendered: $scope.$on('$viewContentLoaded', function () { // do

How to disable or change the path of ghostdriver.log?

谁都会走 提交于 2019-12-03 06:42:25
问题 Question is straightfoward, but some context may help. I'm trying to deploy scrapy while using selenium and phantomjs as downloader. But the problem is that it keeps on saying permission denied when trying to deploy. So I want to change the path of ghostdriver.log or just disable it. Looking at phantomjs -h and ghostdriver github page I couldn't find the answer, my friend google let me down also. $ scrapy deploy Building egg of crawler-1370960743 'build/scripts-2.7' does not exist -- can't

How to install PhantomJS for use with Python Selenium on the Raspberry Pi?

拜拜、爱过 提交于 2019-12-03 06:29:12
I want to run a Python script using Selenium WebDriver with PhantomJS as a headless browser on my Raspberry Pi running Raspbian. I originally wrote the script in OS X where it works fine. But in trying to make it work on the Raspberry, I'm having problems. When trying to run the script, I get this error: raise WebDriverException("Can not connect to the Service %s" % self.path) selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/bin/phantomjs Brief version of the script: from selenium import webdriver from selenium.webdriver.common.desired_capabilities

JavaScript library to simulate Internet Explorer JavaScript environment?

旧时模样 提交于 2019-12-03 06:18:10
This is not a duplicate of the JS library to simulate Internet Explorer? question about simulating Internet Explorer's CSS support; this is about JavaScript functions. Does a JavaScript library exist which can simulate an environment like Internet Explorer's, whereas JavaScript functions are concerned? Basically, it would remove/overwrite the functions not supported by older versions of IE (like indexOf, etc.) or at least force any call to them to be ignored somehow. Effectively, what I'm looking for is something almost like the opposite of Underscore.js and which theoretically could even be

Integrate chrome extensions with phantomjs

China☆狼群 提交于 2019-12-03 06:05:34
Is there a way we can install chrome extensions (.crx) with phantomjs? My task here is to integrate adblockplus with phantomjs so that I can filter all the ad-urls and report using phantomjs. Or any other way to integrate the adblockplus extension with phantomjs? PhantomJS is based on a three-year old WebKit fork (QtWebKit), not Chromium. Therefore you cannot load Chrome extensions in PhantomJS. If you want to use Chrome extensions in an automated way, I suggest to use the ChromeDriver from the Selenium WebDriver project. 来源: https://stackoverflow.com/questions/23603708/integrate-chrome

PhantomJS not mimicking browser behavior when looking at YouTube videos

断了今生、忘了曾经 提交于 2019-12-03 06:04:40
问题 I posted this question to the PhantomJS mailing list a week ago, but have gotten no response. Hoping for better luck here... I've been trying to use PhantomJS to scrape information from YouTube, but haven't been able to get it working. Consider a YouTube video embedded into a web page via an iframe element. If you load the URL referenced by the src attribute directly into a browser, you get a full-page version of the video, where the video is encapsulated in an embed element. The embed