phantomjs

Blacklist and whitelist URLs in HtmlUnitDriver

烈酒焚心 提交于 2019-12-12 01:21:41
问题 Blacklisting URLs in PhantomJS and GhostDriver is pretty straightforward. First initialize the driver with a handler: PhantomJSDriver driver = new PhantomJSDriver(); driver.executePhantomJS(loadFile("/phantomjs/handlers.js")) And configure the handler: this.onResourceRequested = function (requestData, networkRequest) { var allowedUrls = [ /https?:\/\/localhost.*/, /https?:\/\/.*\.example.com\/?.*/ ]; var disallowedUrls = [ /https?:\/\/nonono.com.*/ ]; function isUrlAllowed(url) { function

Curl: Or the equivalent of - For Server Side Javascript

二次信任 提交于 2019-12-12 01:01:14
问题 Popular scripting languages such as Python and PHP have extensions that utilize the Curl library- but little documentation exists for the newer Javascript server side languges. I was wondering --is there a library or hack that can mimic the behavior of Curl in server side Javascript frameworks such as NodeJs and PhantomJs? If no: how can Curl-like requests be made in NodeJs? Or PhantomJs? Also -and most importantly: Is there a "pure javascript" implementation that could work in the runtime of

Upgrading casperjs to use phantomjs 2.0 from 1.9.8

﹥>﹥吖頭↗ 提交于 2019-12-12 00:16:24
问题 I read that people have found ways to get casperjs to work with phantomjs 2.0 but how could I do the upgrade? For example just swapping out phantomjs folder in /usr/.../casperjs/node_modules/phantomjs with a folder for phantomjs2 doesn't seem to do the trick. I've also made the changes in lib/bootstrap.js to handle the warnings from using 2.0. I'm using mocha-casperjs to create my tests. 回答1: If you want to use PhantomJS 2, then you currently need to either install CasperJS from git (which

phantomjs issue on mac with jupyter notebook

北城余情 提交于 2019-12-11 17:53:41
问题 I’m trying to experiment with some code I found at the repo https://github.com/AlbanyCompSci/aeries-api basically to help me login in to this grade portal called aeries and pull my kids high school grades. But I keep getting errors related to “phantomjs”. Also before it was throwing an error about chrome needing to be headless. I’ve got some examples below where I’m loading the module from a local directory and I’ve added the some code to try to resolve the errors. I’m running it on a mac in

Selenium and PhantomJS : webpage thinks Javascript is disabled

和自甴很熟 提交于 2019-12-11 17:45:46
问题 I am running a small script that is mostly checking small things on a website. Today I've come across a really interesting situation I've never seen before, which is the webpage i'm going to thinks Javascript is disabled. This is only happening in PhantomJS , but works fine in Chromedriver . I've even tried changing the driver's headers to ones similiar to Chrome, but still no luck. Is there anyway to get this page to work in PhantomJS without having to use ChromeDriver and PyVirtualDisplay ?

Docker, Cent OS, PhantomJS Font Format Issue

℡╲_俬逩灬. 提交于 2019-12-11 17:23:55
问题 I am running a phantomJS command which converts HTML to a PDF buffer on Docker containing Cent OS. The PDF renders fine, but the font/font format is rendering The available fonts on the system are: /usr/share/fonts/lyx/eufm10.ttf: eufm10:style=LyX /usr/share/fonts/lyx/cmsy10.ttf: cmsy10:style=LyX /usr/share/fonts/lyx/msam10.ttf: msam10:style=LyX /usr/share/fonts/lyx/cmmi10.ttf: cmmi10:style=LyX /usr/share/fonts/lyx/wasy10.ttf: wasy10:style=LyX /usr/share/fonts/lyx/esint10.ttf: esint10:style

Use casper function inside casper.evaluate()

落花浮王杯 提交于 2019-12-11 17:09:08
问题 it's possible using casper function inside casper.evaluate() with jquery code inside? I need to iterare elements in a way similar to how jquery does. I'm loading jquery.js lib This is my try script: casper.evaluate(function(){ $('#size-modal .size-panel-title a').each(function(){ $(this).click(); accordionTab = $(this).attr('href'); casper.capture(screenShotOutput + "PDP-" + accordionTab +".png"); }); }); in this page there are 2 accordion and i want a screenshot for each opened accordion. It

How to include exe file from Nuget in .NET Core AWS Lambda package?

一曲冷凌霜 提交于 2019-12-11 16:01:43
问题 I've added Selenium.PhantomJS.WebDriver to a .NET Core AWS Lambda function which outputs phantomjs.exe to the bin folder when built locally. However, when I publish the project to AWS, the file is not included in the package. How do I tell AWS Toolkit this file needs to be included within the package? 来源: https://stackoverflow.com/questions/56989452/how-to-include-exe-file-from-nuget-in-net-core-aws-lambda-package

How to download a file with phantomJS using Robot Framework?

邮差的信 提交于 2019-12-11 15:25:29
问题 I am using Robot Framework with PhantomJS (headless browser) and want to download a file. But PhantomJS is not having any desired Capabilities or options to set the preferences as we do in Chrome. Looking for any suggestions or other options to download a CSV file using PhantomJS with Robot Framework. 回答1: As you highlighted that downloading files is not the issue. Below you'll find an example of Robot Script that starts Chrome in Headless mode. *** Settings *** Library Selenium2Library Suite

Load The Javascript Of The Page While Loading The Page Itself With CasperJs

我们两清 提交于 2019-12-11 15:06:03
问题 I am trying to submit a form. When I am using firefox the page will be loaded then I open the firebug I can see a input field named "content_html" but when I go to check the source of the page from "view page source" I do not see the input field "content_html" . I checked further and found out there is a javascript which will be loaded in the browser to show that input field. The code is like geteditorinit("http://example.com/pub","data[content_html]",298996,1,750,350,0,0,"content_html"); So