phantomjs

extract elements from a html page

ぐ巨炮叔叔 提交于 2019-12-24 08:58:41
问题 I download some youtube comment page and I want to extract username(or user display name) and the link like from the following code block: <p class="metadata"> <span class="author "> <a href="/channel/UCuoJ_C5xNTrdnc4motXPHIA" class="yt-uix-sessionlink yt-user-name " data-sessionlink="ei=CKG174zFqbQCFZmaIQodtmyE0A%3D%3D" dir="ltr">Sabil Muhammad</a> </span> <span class="time" dir="ltr"> <a dir="ltr" href="http://www.youtube.com/comment?lc=S2ZH2gSPYaef43vTRkLDxUzo2fYicVUc3SFvmYq2jrs"> il y a 1

How to remotely fetch answer of phantomjs script run on heroku?

核能气质少年 提交于 2019-12-24 08:39:28
问题 I want to fetch some information from a website using the phantomjs/casperjs libraries, as I'm looking for the HTML result after all javascripts on a site are run. I worked it out with the following code from this answer: var page = require('webpage').create(); page.open('http://www.scorespro.com/basketball/', function (status) { if (status !== 'success') { console.log('Unable to access network'); } else { var p = page.evaluate(function () { return document.getElementsByTagName('html')[0]

Does changing the user-agent setting in PhantomJS change the perspective of the screen capture/screenshot?

穿精又带淫゛_ 提交于 2019-12-24 07:41:03
问题 I am relatively new to using PhantomJS, and would like to take screenshots of our website to be diffd later on. What I am curious to know is whether or not changing the user-agent setting will affect the perspective of the screenshot (i.e. will the image appear different)? - If it will not, how would you suggest me being able to take screenshots emulating different browsers (hopefully using Phantom, but open to suggestions)? // PhantomJS Code page = require('webpage').create(); // Used for

Phantom/Caperjs User input

拜拜、爱过 提交于 2019-12-24 07:37:10
问题 I have this script // Prompting user to specify the domain and acting on domain system.stdout.writeLine('Enter the domain to test - "UAT1","UAT2","RC" or "LIVE" :'); var testingENV = system.stdin.readLine(); In addition there are other part of my test script which relies on user input system.stdout.writeLine('Enter your NRIC number :'); var NRICno = system.stdin.readLine(); system.stdout.writeLine('Enter your Mobile number in the follwing format (+6588888888) :'); var MOBno = system.stdin

PhantomJS set browser timezone setting

主宰稳场 提交于 2019-12-24 06:26:04
问题 I am running Karma with PhantomJS to run some unit tests. In my unit tests there are some tests which do some date comparison which all pass when run locally. Our build server is on a different timezone and the date tests are failing due to different timezones. I looked at phantomjs options to and didn't see any option regarding locale or timezone. Is it possible to configure phantomJs to the same timezone on every computer even though they are different timezones ? 回答1: If you're running it

Amazon Login Phantom JS

偶尔善良 提交于 2019-12-24 06:01:48
问题 I’m pretty new at PhantomJS and programming in general, so please bear with me. I’m trying to write a code to login to my Amazon account, and add shipping addresses to my address book. The code I’m using is here: var steps=[]; var loadInProgress = false;//This is set to true when a page is still loading /*********SETTINGS*********************/ var webPage = require('webpage'); var page = webPage.create(); page.settings.userAgent = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36

PhantomJS - Rendering fails to show all images

这一生的挚爱 提交于 2019-12-24 05:24:11
问题 I have a phantomjs script that is stepping through the pages of my site. For each page, I use page = new WebPage() and then page.close() after finishing with the page. (This is a simplified description of the process, and I'm using PhantomJS version 1.9.7.) While on each page, I use page.renderBase64('PNG') one or more times, and add the results to an array. When I'm all done, I build a new page and cycle through the array of images, adding each to the page using <img src="data:image/png

getting error: Could not start Ghost Driver

别等时光非礼了梦想. 提交于 2019-12-24 05:12:08
问题 I'm trying to run Ghostdriver inside my Openshift server. As i run this command: ./phantomjs --webdriver=15002 It says: PhantomJS is launching GhostDriver... [ERROR - 2014-08-01T04:14:21.160Z] GhostDriver - main.fail - {"message":"Could not start Ghost Driver","line":82,"sourceId":139887801789952,"sourceURL":":/ghostdriver/main.js","stack":"Error: Could not start Ghost Driver\n at :/ghostdriver/main.js:82","stackArray":[{"sourceURL":":/ghostdriver/main.js","line":82}]} $ ./phantomjs --version

TrueZip: NoClassDefFoundError (but for shutdown hook only?)

ぃ、小莉子 提交于 2019-12-24 03:12:27
问题 I have a project using PhantomJS. There is this plugin that will install it automatically: <plugin> <groupId>com.github.klieber</groupId> <artifactId>phantomjs-maven-plugin</artifactId> <version>0.2.1</version> <executions> <execution> <goals> <goal>install</goal> </goals> </execution> </executions> <configuration> <version>1.9.2</version> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version>

TrueZip: NoClassDefFoundError (but for shutdown hook only?)

こ雲淡風輕ζ 提交于 2019-12-24 03:12:25
问题 I have a project using PhantomJS. There is this plugin that will install it automatically: <plugin> <groupId>com.github.klieber</groupId> <artifactId>phantomjs-maven-plugin</artifactId> <version>0.2.1</version> <executions> <execution> <goals> <goal>install</goal> </goals> </execution> </executions> <configuration> <version>1.9.2</version> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.18.1</version>