phantomjs

Why Casperjs can only load half page of Outlook.com? Images included

旧街凉风 提交于 2019-12-12 05:14:51
问题 is there any one know what kind of problem is that? should i add any path to support casperjs? any solution to make it displayable? thanks for your help. Click here for picture: First picture is using casperjs, which cant load like a regular browser 来源: https://stackoverflow.com/questions/35670589/why-casperjs-can-only-load-half-page-of-outlook-com-images-included

Unable to assert axis label text in highcharts using Geb

╄→гoц情女王★ 提交于 2019-12-12 04:53:58
问题 I am writing a geb test that asserts the axis labels in a highcharts graph. The test I wrote works when run with the selenium chrome driver. When I run with phantomjs it fails. //Selector in GEB $(id:"graph-id").find("g.highcharts-legend-item").find("tspan").text() This returns as expected in Chrome. It returns empty in phantomjs. We have to use phantomjs for our CI builds. 回答1: If for whatever reason geb isn't supporting your phantomjs driver properly, you can always execute a javascript

casperjs: how do I click a remote div and then update it's class name?

前提是你 提交于 2019-12-12 04:45:45
问题 As a way of learning CasperJS, I am trying to initiate a click event on a div on a remote page, and then change the class name of the div after I have clicked it. The idea is to find the first clickable div, click it, and then mark it as clicked so I can skip over it to other clickable divs. The markup for the div tag on the remote page looks like: <div class='clickable_div'></div> I have tried the following casperjs code: ... casper.then(function() { if( this.exists( 'div.clickable_div' ) )

Node,js doesn´t find any modules

戏子无情 提交于 2019-12-12 04:24:29
问题 I am trying to do one of the node-horseman examples, but I am finding with a problem. The example I am trying to follow is this: var Horseman = require('node-horseman'); var horseman = new Horseman(); var numLinks = horseman .open('http://www.google.com') .type('input[name="q"]', 'github') .click("button:contains('Google Search')") .waitForNextPage() .count("li.g"); console.log("Number of links: " + numLinks); horseman.close(); And the errors it throws when I make phantomjs example.js are

SPNEGO authentication in Phantom

爷,独闯天下 提交于 2019-12-12 04:13:39
问题 Experimenting with Phantomjs to scrape some information from a vendor application our company uses. When I open the page and render it, I can see that the only output is the message SPNEGO authentication is not supported on this client. I had seen that message in Firefox before, and the solution was to add the host to the trusted uris. That's great for FF, but in the context of a phantomjs script, is there a way to declare a site as trusted? UPDATE: Tried the command-line parameters per

Headless webkit wrapper/driver no install for .net

岁酱吖の 提交于 2019-12-12 04:12:17
问题 I'm looking for an embedded headless browser for .net with the following properties: Modern Webkit level of Ajax/HTML5 support and preferably webkit based Headless mode capable (no visible browser), more speed it better Zero install (something like browser.exe and a c# wrapper DLL copied into the project) Reliable for production usage for basic tasks (like screen shots of complex pages), I'm not looking for 99.9999 reliability here, but it needs to be stabler and faster than Selenium, we have

前端进阶---单元测试入门

老子叫甜甜 提交于 2019-12-12 04:08:06
什么是单元测试? 对软件中最小可测单元进行测试(如:一个方法function) 引入单元测试的原因?(一般是大的项目时) - 分模块开发,方便的定位到哪个单元出了问题 - 保证代码质量 - 驱动开发(测试驱动开发) TDD: 测试驱动开发,从需求角度看,即我需要结果是什么,如果不是就是错误的。(需求分析-》编写单元测试-》编写代码使单元测试通过-》重构) BDD: 行为驱动开发,从具体功能角度出发看,即结果应该是什么,如果不是什么就出错。(从业务角度定义目标-》找到实现目标的方法-》编写单元测试-》实现行为-》检查产品) 先写测试用例,再开发满足测试用例 测试的原则 及时修改和维护 Code review:代码审查 偶尔代码审核 同步 异步(借助工具) 只测单一的点 尽量贴近真实 避免测试中逻辑过于复杂 单元测试详解 单元测试的核心内容 测试框架 测试运行的基础 框架 Jest :基于jasmine,对react友好 jasmine :自带assert,mock Mocha :全面适合node和浏览器两个端(适合自定义高的) Qunit 出自是Query 断言库 自己对自己的断言,判断结果 工具: Chai -支持所有风格【常用】, Assert -node环境直接使用, Should,expect -用得少 Mock库 用于屏蔽其他方法的数据影响 工具: sinon Test

Pop up handling through PhantomJs in Java

徘徊边缘 提交于 2019-12-12 03:54:06
问题 Hi, I have a html page as below and i need to handle pop up generated in it in phantomjs using java code.Please provide the solution code. <html> <body> Card Number: <br> <input type="text" name="Card Number" value=""> <br> Card Holder Name: <br> <input type="text" name="Card Holder Name" value=""> <br><br> CVV: <br> <input type="text" name="CVV" value=""> <br> <br> <input type="button" value="proceed" onclick="myFunction()"> <script> function myFunction() { var x; if (confirm("Would you like

How to Change select value using PhantomJS

非 Y 不嫁゛ 提交于 2019-12-12 03:45:34
问题 I made a scraper using PhantomJS inside node (Node Module). I am trying to get data from a table on the page (url). When the page loads it only displays 25 records of the table. There is a 'select' at the bottom that you can change to 'All' to see all records. How can i change the value of the select to 'All' before getting the HTML returned? var phantom = require('phantom'); phantom.create().then(function(ph){ ph.createPage().then(function(page){ page.open(url).then(function(status){ console

Phantomjs can't load iframe

拈花ヽ惹草 提交于 2019-12-12 03:44:35
问题 I'm a newbie, recently started to use phantomjs with casperjs. I want to get info from an iframe but phantomjs fails to load it. This is my script: var casper = require('casper').create({ verbose: true, logLevel: "debug", waitTimeout: 20000, retryTimeout: 100, viewportSize: { width: 1920, height: 1080 }, pageSettings: { "userAgent": 'Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.41 Safari/535.1' }, localToRemoteUrlAccessEnabled: true }); casper.start();