phantomjs

cant get CasperJS to work on Mac OSX

孤者浪人 提交于 2019-12-11 05:53:34
问题 Tried almost everything, ending up with removing all npm&node (and node modules) and installing again. same results: CasperError: Can't find module fs phantomjs://code/bootstrap.js:297 in patchedRequire phantomjs://platform/colorizer.js:35 CasperError: Can't find module fs phantomjs://code/bootstrap.js:297 in patchedRequire phantomjs://platform/casper.js:36 TypeError: undefined is not a constructor (evaluating 'require('casper').create()') phantomjs://code/cloner.js:1 in global code :0 in

How to enable PhantomJS WebDriver in Selenium?

≯℡__Kan透↙ 提交于 2019-12-11 05:52:00
问题 I need to rewrite my Java program from ChromeDriver to PhantomJS. I think i should just enable PhantomJS instead of ChromeDriver and nothing more (am i right?). I tried a few ways to do this, but i always get NoClassDefFoundError. My way of enabling ChromeDriver: System.setProperty("webdriver.chrome.driver", CHROMEDRIVER_PATH); WebDriver driver = new ChromeDriver(); And this is how i tried to enable PhantomJS: DesiredCapabilities DesireCaps = new DesiredCapabilities(); DesireCaps

Scroll over website using phatomJS and selenium

旧城冷巷雨未停 提交于 2019-12-11 05:46:23
问题 I need to scroll over a web page (example twitter) an make a web scraping of the new elements that appear as one advances on the website. I try to make this using python 3.x , selenium and PhantomJS . This is my code import time from selenium import webdriver from bs4 import BeautifulSoup user = 'ciroylospersas' # Start web browser #browser = webdriver.Firefox() browser = webdriver.PhantomJS() browser.set_window_size(1024, 768) browser.get("https://twitter.com/") # Fill username in login

Script is timing out and not finding selector

旧街凉风 提交于 2019-12-11 05:08:36
问题 I'm trying to load this page: https://login.morganstanleyclientserv.com/ My current code: var casper = require('casper').create(); var x = require('casper').selectXPath; var userName = 'xxxxxx'; var Password = 'xxxxxx'; casper.userAgent('Mozilla/4.0 (comptible; MSIE 6.0; Windows NT5.1)'); casper.start('https://login.morganstanleyclientserv.com/') casper.then(function () { this.sendKeys('#txtUsername', userName); console.log('Entering Username'); }); casper.then(function() { this.sendKeys('

Rails page JS works in real browser / manual testing but not in PhantomJS & Selenium specs

我是研究僧i 提交于 2019-12-11 04:27:33
问题 In one of my Rails projects, I'm working on an interface to do CRUD operations on a resource ( Commands ) fully via AJAX (ie. no page reload needed). So there's a link to add a Command to the list, the user can click on any Command to edit its data then click Save to update via AJAX, and so forth. This last operation (clicking the Update button) is causing me trouble: it works perfectly in any browser I've tried, but when I follow the exact same steps in my Capybara specs (using either

How to add PhantomJSDriver command line arguments [duplicate]

风格不统一 提交于 2019-12-11 04:03:01
问题 This question already has answers here : Why won't PhantomJSDriver use the capabilities I set? (2 answers) Closed 4 years ago . How can I specify command line arguments for my Java PhantomJSDriver? For example, I want to set --ignore-ssl-errors=yes on the script that I run. 回答1: Simply add to phantomJS's default desired capabilities, like so: DesiredCapabilities desiredCapabilities = DesiredCapabilities.phantomjs(); desiredCapabilities.setCapability("phantomjs.cli.args", Collections

How to get java class in CF

社会主义新天地 提交于 2019-12-11 03:51:43
问题 I want to access the return value from a java method in my coldfusion file. I have loaded all the jar files in coldfusion file and got the java class object successfully. Using the class object, I want to access java class method which returns a Set ; but I can't get any return value. Here is my Java Code: public Set getSession(String url) { result+="hello"; try { DesiredCapabilities caps = new DesiredCapabilities(); caps.setJavascriptEnabled(true); caps.setCapability("takesScreenshot", false

How to unit test javascript function that calls getJSON

爱⌒轻易说出口 提交于 2019-12-11 03:39:08
问题 I've been struggling with unit test for 2 days now and there is something I can't achieve regarding async test. I'm new to unit test and I don't understand why this doesn't work. I have a file login.js that calls a $.getJSON(url, data, function) and returns a string with the status of login ("success" or "fail"). The call to $.getJSON uses mockjax to get the data (it wraps an ajax call). The login function works ok, when called from a test webpage using jQuery click event. But now I'm trying

Window object in PhantomJS

心已入冬 提交于 2019-12-11 03:29:33
问题 I have seen in some documentation of PhantomJS that it can access the global "document" object but I don't know if it is also possible to access the global "window" object. So my question is, is there a special way or I can just call the window object directly after I initialize a page using PhantomJS? 回答1: Running phantomjs from a terminal gives you an interactive session you can play around with. If you then run console.log(window) you'll see you have access to the window object. phantomjs>

Why phantomjs not working in MacOS Sierra?

旧街凉风 提交于 2019-12-11 03:27:57
问题 We are using phantomjs-1.9.1-macosx , phantomjs-2.0.0-macosx which one working fine on OS X El Capitan after having update with MacOS Sierra it raise following errors: phantomjs-1.9.1-macosx $ ./phantomjs-1.9.1-macosx/bin/phantomjs -v Segmentation fault: 11 phantomjs-2.0.0-macosx ./phantomjs-2.0.0-macosx/bin/phantomjs -v Killed: 9 Anybody face such type of difficulties and overcome it? Your help is appreciated. 来源: https://stackoverflow.com/questions/39721538/why-phantomjs-not-working-in