phantomjs

Output client-side console with casper/phantomjs

蓝咒 提交于 2019-12-30 03:44:16
问题 Going through the casperjs documentation I couldn't find where I could see the console.log from client-side javascript. Is this possible? 回答1: I'm not really sure to fully understand your question, but you can do something like the following: var casper = require('casper').create({ logLevel: "debug" }); casper.on('remote.message', function(message) { this.echo(message); }); casper.start('http://google.com/', function() { this.evaluate(function sendLog(log) { // you can access the log from

casperjs does not find phantomjs

早过忘川 提交于 2019-12-30 02:37:07
问题 I've downloaded the latest version of casperjs (1.03) and phantomjs (1.9.2). So I took this little simple script from the casper page: var casper = require('casper').create({ verbose: true, logLevel: "debug" }); var casper = new require('casper').Casper(); and when I try to run it I get the following error: noname:phantomjs-1.9.2 Tom$ casperjs/bin/casperjs tipico2.js Fatal: [Errno 2] No such file or directory; did you install phantomjs? So, this is my directory structure: phantomjs-1.9.2/ <--

How to run PhantomJS as a server and call it remotely?

梦想与她 提交于 2019-12-30 00:39:09
问题 This is probably a very basic question. I would like to run a headless browser PhantomJS as a server but not as a command line tool. Once it is running I would like to call it remotely over HTTP. The only thing I need is to send a URL and get back the HTML output. I need it to generate HTML for an AJAX application to make it searchable. Is it possible ? 回答1: You can run PhantomJS perfectly fine as a webserver, because it has the Web Server Module. The examples folder contains for example a

Check if my javascript is loaded on a site

扶醉桌前 提交于 2019-12-29 09:22:22
问题 I have asked this question before but it seems i got misunderstood therefore i decided to ask again but this time with alot of information: For the lazy reader my goal here is: Is there a way to check if a javascript is enabled on an external site either from PHP or through Ajax Detailed description: Okay, so my company, has many clients, when these clients sign up on our website, they are handed a javascript . They can then use this script on their own website to get some extra features. Now

Check if my javascript is loaded on a site

萝らか妹 提交于 2019-12-29 09:22:05
问题 I have asked this question before but it seems i got misunderstood therefore i decided to ask again but this time with alot of information: For the lazy reader my goal here is: Is there a way to check if a javascript is enabled on an external site either from PHP or through Ajax Detailed description: Okay, so my company, has many clients, when these clients sign up on our website, they are handed a javascript . They can then use this script on their own website to get some extra features. Now

PhantomJS and getting modified DOM

谁说我不能喝 提交于 2019-12-29 04:57:07
问题 I'm developing a tool that needs to download a web page from 3rd party server, execute it as a browser would and then parse the HTML. What I struggle with is that the tool need to parse the HTML after all javascript is executed and DOM is modified. I'm trying to use PhantomJS for this purpose and it works on small snippets of code (just a tiny html document with external javascript that adds some nodes to DOM) but when I do the same with a real site (http://www.dba.dk/) I'm not getting the

PhantomJS- open page with LocalStorage by default

六月ゝ 毕业季﹏ 提交于 2019-12-28 23:08:12
问题 I'm using PhantomJS to get the generated source of a web page after JavaScript DOM manipulations have taken place. This web page has JUST a <body> and nothing else. Important : This web page uses browser's localStorage to generate the page. I want to change LocalStorage in PhantomJS before opening the page. App.js : var page = require('webpage').create(); page.open("https://sample.com") setTimeout(function(){ // Where you want to save it page.render("screenshoot.png") // You can access its

SVG images blocked by gmail proxy

半世苍凉 提交于 2019-12-28 16:30:10
问题 It seems like the new gmail proxy for images doesn't work with SVG (gives a 404 error if you open the proxy url in a new tab.) I haven't been able to find any documentation about supported/blocked file-types. Is SVG in gmail working for anyone else? The only workaround I can think of is to generate a png of the svg on the server using PhantomJS - any other options? Background: This is for a webapp that sends daily summary emails, showing a graph covering the last 24 hours (so the svg is

SVG images blocked by gmail proxy

☆樱花仙子☆ 提交于 2019-12-28 16:30:07
问题 It seems like the new gmail proxy for images doesn't work with SVG (gives a 404 error if you open the proxy url in a new tab.) I haven't been able to find any documentation about supported/blocked file-types. Is SVG in gmail working for anyone else? The only workaround I can think of is to generate a png of the svg on the server using PhantomJS - any other options? Background: This is for a webapp that sends daily summary emails, showing a graph covering the last 24 hours (so the svg is

Python爬虫实战,60行代码爬取英雄联盟全英雄全皮肤,找寻曾今那些被删除的绝版皮肤

橙三吉。 提交于 2019-12-28 16:00:58
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 学了一周多的爬虫课后终于按捺不住了,小编决定自己手动编写爬虫程序,刚好LJ在鼓励学员分享成果,优秀作品有奖励,就把自己用Python编程爬取各大游戏高清壁纸的过程整理了出来进行投稿,与大家一起分享。 爬取了当前比较火的游戏壁纸,MOBA游戏《英雄联盟》,手游《王者荣耀》、《阴阳师》,FPS游戏《绝地求生》,其中《英雄联盟》的壁纸最难爬取,这里展示爬取《英雄联盟》全部英雄壁纸的过程,学会了这个,自己再去爬取其他游戏壁纸也就不成问题啦。 先看一下最终爬取的效果,每个英雄的壁纸都被爬取下来了: “黑暗之女 安妮”的12张壁纸: 高清大图: 下面开始正式教学! 版本:Python 3.5 工具:Jupyter notebook实现各个环节,最终整合成LOL_scrawl.py文件 1.了解爬取对象,设计爬取流程 在使用爬虫前,先花一定时间对爬取对象进行了解,是非常有必要的,这样可以帮助我们科学合理地设计爬取流程,以避开爬取难点,节约时间。 1.1英雄基本信息 打开英雄联盟官网,看到所有英雄的信息: 若要爬取全部英雄,我们先要获取这些英雄的信息,在网页上“右击——检查——Elements”,就能在看到英雄的信息了,如下图所示,包括英雄昵称、英雄名称、英文名等等。由于这些信息是使用JavaScript动态加载的