phantomjs

How to get get URL of new page using casperJS

让人想犯罪 __ 提交于 2019-12-11 00:20:11
问题 I am using casperJS to get links when clicking a button. The links are returned with window.open in javaScript. The code I have written logs all the pages after clicking button, but phantom is not exiting in terminal window. Also some pages only show about:blank, especially the last ones. var casper = require('casper').create(); var page = require('webpage').create(); var address = 'http://www.example.com'; page.open(address, function() { page.onPageCreated = function(newPage) { newPage

PhantomJS from Node on Windows

人盡茶涼 提交于 2019-12-11 00:00:45
问题 I have written a Electron application using Node, Electron Boilerplate, and phantom. It works perfectly fine for me on my linux machine, I copied the source over to Windows 10, and ran with npm start , and all goes smoothly. However, when I try to build the application with the boilerplate module using npm run release , things go a little less smoothly. I can install and open the application just fine, but when I click the button that activates the phantom module, the windows goes all white

Dynamic scraping using nodejs and phantomjs

你说的曾经没有我的故事 提交于 2019-12-10 23:36:59
问题 First of all, I've installed successfully both PhantomJs and its npm interface phantom. I've set the code to load my page with the new syntax (All the other questions posted on here were based on the old code syntax or I'm missing something). this is the source I'm trying to scrape. Now, the right sidebar, the one with the fake select near "Comune" and the other one are generated dynamically and I can't understand why phantomjs isn't picking them up. Following my code: var sito = "http:/

html-pdf: css and js files do not appear to be processing

我们两清 提交于 2019-12-10 22:54:18
问题 I am taking a webpage, using jquery to load the page on document.ready, css to format the page, node.js http to retrieve the page from the server, html-pdf to convert the html to a pdf file. From this point, I am sending the file as an email attachment. The ultimate goal is to create an invoice. The issue is that the css and js do not appear to be processing when it is in external files. I would prefer to keep in external files but need jquery to populate the page on document.ready and the

Is it possible capture and log my own Websocket (wss) traffic

自作多情 提交于 2019-12-10 22:46:34
问题 How I can use PhantomJs to capture and log my own data traffic coming from a websocket and destined to my browser ? 回答1: You can try an approach with the following working example for PhantomJS 2.1.1. It opens sample page at http://www.websocket.org/echo.html and prints data traffic (input and output), along with some extra debug information. The traffic itself is not very interesting, but fits for the demonstration purpose. Hope, this helps. var webPage = require('webpage'); var page =

Protractor error using PhantomJS

微笑、不失礼 提交于 2019-12-10 21:33:18
问题 I'm using phantomJS and protractor to run an e2e-test on my angular page, generated by gulp (standard angular-generator). When I want to run the second command, I will get the following error: "error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability..." phantomjs --webdriver=5000 gulp protractor I already looked it up on the internet, also on stackoverflow, but it didn't come to a solution. Everyone says it's because

Headless browsers and Windows Azure Websites

若如初见. 提交于 2019-12-10 20:57:01
问题 I´m trying to use a headless browser for crawling purposes to add SEO features in a open source project i´m developing. The project sample site is deployed via Azure Websites. I tried several ways to get the task working using different solutions like Selenium .NET (PhantomJSDriver, HTMLUnitDriver, ...) or even standalone PhantomJs .exe file. I´m using a headless browser because the site is based in DurandalJS, so it needs to execute scripts and wait for a condition to be true in order to

java.security.AccessControlException: access denied (“java.net.SocketPermission” “localhost:10648” “listen,resolve”)

こ雲淡風輕ζ 提交于 2019-12-10 20:51:51
问题 I am calling a jar file from CF. Inside CF I have created a java class object successfully. When I am going to call my function that time, it generates the following error: java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:10648" "listen,resolve") How can I overcome this exception? I have deployed our code in a CF 10 server. Here is my login.cfm file code: <cfsetting requesttimeout="1000000"> <!---Setting phantomJS path start---> <cfset phantompath =

PhantomJs: inline HTML with external CSS file

廉价感情. 提交于 2019-12-10 19:39:19
问题 I'm attempting to render some inline HTML which links to an external css file using the following PhantomJs script: var page = require('webpage').create(); page.content = ''; page.content += '<html><head>'; page.content += '<link rel="stylesheet" href="http://example.com/css/layout.css" type="text/css" media="Screen">'; page.content += '</head><body>'; page.content += '<h1>test</h1>'; page.content += '</body></html>'; page.onResourceRequested = function(requestData, request) { console.log(':

Why is the Cookie Header not set on my same-domain $.ajax request within phantomjs?

半世苍凉 提交于 2019-12-10 19:34:55
问题 I am issueing requests within the same domain via jQuery's $.ajax(request) function. Unfortunately the Cookie header is never set (neither POST nor GET ) and I don't know why. If i understand jQuery Ajax correctly, the Cookie header should be set according to the pages cookies (like document.cookie ). I've traced document.cookie and to me it seems that it is updated correctly (according to the Set-Cookie header) with every xhr response. But when debugging the Requests all have the Cookie