phantomjs

PhantomJS querySelectorAll().textcontent returns nothing

瘦欲@ 提交于 2019-12-13 04:07:10
问题 I create a simple web scraper to grab data from a website by using phantomjs. It's doesn't work for me when I used querySelectorAll to get content which I want. Here is my whole code. var page = require('webpage').create(); var url = 'https://www.google.com.kh/?gws_rd=cr,ssl&ei=iE7jV87UKsrF0gSDw4zAAg'; page.open(url, function(status){ if(status === 'success'){ var title = page.evaluate(function(){ return document.querySelectorAll('.logo-subtext')[0].textContent; }); console.log(title); }

Need headless browser for Armv7 linux processor

点点圈 提交于 2019-12-13 03:54:41
问题 I need a headless browser for webscraping.Recently i tried 3 different headless browsers( PhantomJS,Firefox,Chrome ). When using phantomJS , it gives some error (i.e):Armv7 processor needs GUI . then,am using Firefox with geckodriver , it shows errors in the path and connection refused . so that i moved to chrome headless browser with chromedriver ,but it also shows same errors as Firefox . So,I need a correct headless browser for Armv7 processor. Can anyone suggest solution for that or any

casperjs fill and click not working as i expected cannot click button

可紊 提交于 2019-12-13 03:51:51
问题 okay so i will post to sets of code below one the html form i am trying to use and submit and my casperjs code i am trying. the problem comes when trying to click the submit button i take a screenshot and get the resulting html but for some reason the html has no change at all and the screenshot shows the fields filled in but the form has not been submitted can someone help me heres the html <form action="userlogin.html" method="post" name="reg" id="reg" onsubmit="document.getElementById('sbt

How can I make the phantomJS webdriver to wait until a specific HTML element being loaded and then return the page.source?

不想你离开。 提交于 2019-12-13 03:49:49
问题 I have developed the code below for a web crawling object. It takes two dates as inputs.Then creates a list of dates between these two dates and attach each one to a webpage url which contains weather information of a location. Then it converts HTML tables of data into Dataframe and after that stores data as csv file in storage (the base link is: https://www.wunderground.com/history/daily/ir/mashhad/OIMM/date/2019-1-3 and as you can see in this example the date is 2019-1-3): from datetime

Phantomjs browser incorrectly computing css calc() function in Nightwatch tests

我是研究僧i 提交于 2019-12-13 03:00:01
问题 I am building Nightwatch tests (uses Phantomjs) for functioning front ends, and one of my tasks is to make sure banner images' heights are dynamic and their heights are being calculated correctly per the screen size. I have some page elements that look something like this: //html <div class="bannerImg"></div> //css .bannerImg { background-image: url('someImgUrl'); height: calc(100vh - 200); //some calculation here min-height: 600px; //some minimum height } For example, a viewport of 1080

Open Graph Metatags for every URL instead of page

我的未来我决定 提交于 2019-12-13 02:31:07
问题 I have developed a page similar to facebook wall which have list of post in Angular (SPA). Every post have unique url to reach exactly to that post. I am new to open graph metatags. I have inserted metatags in head tag. <meta property="og:url" content="#####"/> <meta property="og:type" content="website"/> <meta property="og:title" content="####"/> <meta property="og:description" content="######"/> <meta property="og:image" content="/images/####.png"/> The meta tags are common for every post,

Returning links inside iframe using a function in CasperJS

核能气质少年 提交于 2019-12-13 02:26:16
问题 I am trying to get the links from inside an iframe and return them as a function result, my simplified code looks something like this: var casper = require("casper").create({ verbose: true, logLevel: "debug", webSecurityEnabled: false }); var url = casper.cli.get(0); casper.on('remote.message', function(msg) { this.echo(msg); }) casper.start(url, function () { thelinks = getLinksFromIframes( casper ); console.log("doesn't work:" + thelinks); }); function getLinksFromIframes( context ) { var

phantomjs output file size: png v gif

半城伤御伤魂 提交于 2019-12-13 02:01:58
问题 With phantomjs you can choose the file format to use for page.render(). I'm finding that the file size I'm getting for png is around three times higher than what I'm getting for gif. I wasn't aware that png should be any worse (in terms of file size) than gif; in fact I thought png was meant to be better. Unfortunately, I kinda need to output to png because of its support for variable opacity, but the larger file size is a bit of an issue. So, is there any way in which I can control file size

Issue launching Phantomjs Selenium Web Driver

穿精又带淫゛_ 提交于 2019-12-13 01:34:34
问题 I'm using phantom.js driver for selenium in some java code. It's a large project so i'll only copy what I think is the relevant code. I had it working fine with the firefox driver. I instantiate it here: Capabilities caps = new DesiredCapabilities(); ((DesiredCapabilities) caps).setJavascriptEnabled(true); ((DesiredCapabilities) caps).setCapability("takesScreenshot", true); ((DesiredCapabilities) caps).setCapability("timeoutInSeconds", 20); ((DesiredCapabilities) caps).setCapability(

Retrieved anchors list gets corrupted?

风流意气都作罢 提交于 2019-12-13 01:27:37
问题 I am trying to analyze anchor links ( their text property ) in PhantomJS. The retrieval happens here: var list = page.evaluate(function() { return document.getElementsByTagName('a'); }); this will return an object with a property length which is good (the same length I get when running document.getElementsByTagName('a'); in the console). But the vast majority of the elements in the object have the value of null which is not good.. I have no idea why this is happening. I have been playing with