phantomjs

Phantomjs not render hebrew fonts

夙愿已清 提交于 2020-01-01 05:38:05
问题 I am using PhantomJs 1.9.2 on Centos 6.3 to for automated ui tests. When a test fails, screenshots are saved to the server. My problem is that even though the screenshots are saved, they do not contain readable fonts. So if the website reads like this: חיים טכנולוגיים the screenshot of the site will look like this: םםםםםםםםםםםםם So, instead of the actual letters, it renders and saves little boxes. The system is centos 6.3. Freetype and Fontconfig are also installed. How could I go about

How to for loop in casperjs

拥有回忆 提交于 2020-01-01 05:37:24
问题 I am trying to click a 'next' button N number of times and grab the page source each time. I understand that I can run an arbitrary function on the remote website, so instead of click() I just use the remote function nextPage() How do I run the following, an arbitrary number of times: var casper = require('casper').create(); casper.start('http://www.example.com', function() { this.echo(this.getHTML()); this.echo('-------------------------'); var numTimes = 4, count = 2; casper.repeat(numTimes

CasperJS can not trigger twitter infinite scroll

天大地大妈咪最大 提交于 2020-01-01 05:12:11
问题 I am trying to get some information from twitter using CasperJS . And I'm stuck with infinite scroll. The thing is that even using jquery to scroll the page down nothings seems to work. Neither scrolling, neither triggering the exact event on window (smth like uiNearTheBottom) doesn't seem to help. Interesting thing - all of these attempts work when injecting JS code via js console in FF & Chrome. Here's the example code : casper.thenEvaluate(function(){ $(window).trigger('uiNearTheBottom');

karma.conf.js automatic file ordering?

不羁岁月 提交于 2020-01-01 05:03:34
问题 I have a large angularjs project ordered by features. I'd like to setup unit testing but I'm having trouble getting the karma.conf.js file ordering setup. I tried specifying a simple glob pattern like **/*.js but many of my modules failed to load due to the ordering that they're included in Karma when ran. As I understand, it's alphabetical, first match. I was able to resolve this by manually figuring out the ordering by doing something like this: // list of files / patterns to load in the

karma.conf.js automatic file ordering?

ε祈祈猫儿з 提交于 2020-01-01 05:03:08
问题 I have a large angularjs project ordered by features. I'd like to setup unit testing but I'm having trouble getting the karma.conf.js file ordering setup. I tried specifying a simple glob pattern like **/*.js but many of my modules failed to load due to the ordering that they're included in Karma when ran. As I understand, it's alphabetical, first match. I was able to resolve this by manually figuring out the ordering by doing something like this: // list of files / patterns to load in the

PhantomJS using too many threads

大憨熊 提交于 2020-01-01 00:44:11
问题 I wrote a PhantomJS app to crawl over a site I built and check for a JavaScript file to be included. The JavaScript is similar to Google where some inline code loads in another JS file. The app looks for that other JS file which is why I used Phantom. What's the expected result? The console output should read through a ton of URLs and then tell if the script is loaded or not. What's really happening? The console output will read as expected for about 50 requests and then just start spitting

Using phantomjs for dynamic content with scrapy and selenium possible race condition

笑着哭i 提交于 2019-12-31 22:57:14
问题 First off, this is a follow up question from here: Change number of running spiders scrapyd I'm used phantomjs and selenium to create a downloader middleware for my scrapy project. It works well and hasn't really slowed things down when I run my spiders one at a time locally. But just recently I put a scrapyd server up on AWS. I noticed a possible race condition that seems to be causing errors and performance issues when more than one spider is running at once. I feel like the problem stems

PhantomJS download using a javascript link

大憨熊 提交于 2019-12-31 13:13:42
问题 I am attempting to scrape the below website: http://www.fangraphs.com/leaders.aspx?pos=all&stats=bat&lg=all&qual=0&type=8&season=2011&month=0&season1=2011&ind=0&team=0&rost=0&players=0 If you click the small button at the top-right of the table titled "export data", a javascript script runs and my browser downloads the file in .csv form. I'd like to be able to write a PhantomJS script that can do this automatically. Any ideas? The above button is coded into HTML as such: <a id="LB_cmdCSV"

A specific site is returning a different response on python and in chrome

一曲冷凌霜 提交于 2019-12-31 07:25:10
问题 I am trying to access a specific site using python, and no matter which lib I use I just can't seem to access it. I have tried Selenium+PhantomJS, I have tried requests and urllib. Whenever I try to access the site from the browser I get a json file, and whenever I try to access it from a python script I get an html file (which has a huge minified script inside it) I suspect this site is detecting I'm sending the request headlessly and is blocking my requests, but I can't figure out how. The

How to change current page in Phantomjs using buttons? [duplicate]

你离开我真会死。 提交于 2019-12-31 05:11:28
问题 This question already has an answer here : Open link in PhantomJS synchronously (1 answer) Closed 3 years ago . I have start to using Phantomjs and I don't understand something. How to change current page using buttons? For example I've got a code: var page = require('webpage').create(); page.open('https://ru-ru.facebook.com', function() { page.injectJs('jQuery.js'); page.evaluate(function() { $('#email').val('MyLogin'); $('#pass').val('MyPass'); $('#u_0_l').click(); }); page.render('example