phantomjs

使用命令行工具npm新创建一个vue项目

混江龙づ霸主 提交于 2019-12-24 15:01:44
使用命令行工具npm新创建一个vue项目 使用vue开发项目的前期工作可以参考前面写的: Vue环境搭建及node安装过程整理 Vue.js 提供一个官方命令行工具,可用于快速搭建大型单页应用。该工具提供开箱即用的构建工具配置,带来现代化的前端开发流程。 只需几分钟即可创建并启动一个带热重载、保存时静态检查以及可用于生产环境的构建配置的项目: # 全局安装 vue-cli $ npm install --global vue-cli # 创建一个基于 webpack 模板的新项目 $ vue init webpack my-project $ vue init webpack test //输入命令 ? Project name (test) test ? Project name test ? Project description (A Vue.js project) 测试项目 ? Project description 测试项目 ? Author lxx1024 ? Author lxx1024 ? Vue build standalone ? Install vue-router? (Y/n) Y //安装路由 ? Install vue-router? Yes ? Use ESLint to lint your code? (Y/n) n //Eslint验证,很严谨

phantomjs on linux returns empty html source

纵然是瞬间 提交于 2019-12-24 14:47:18
问题 we´d like to use phantomjs to connect to a our internal documentation system and print the source code of the website for further usage. The script is basically from the examples: > var page = require('webpage').create(), > system = require('system'); > > page.open('https://servername.domain.net/web/topicname?refresh=on', > function () { > console.log(page.content); > phantom.exit(); }); We downloaded the binary package from the phantomjs homepage and extracted it to our debian jessie server

Download img/png mime type , casperJS

こ雲淡風輕ζ 提交于 2019-12-24 14:27:32
问题 I'm having a casperJS script to trigger an image download on a button click. I have clicked the button, and the resouce.recived has a file of type image/png. How do I download that and save ? When I tried download(resource, "something.png); I get to download HTML(source code of the page) and not the desired image. Relevant segment of my code : var dFile = casper.on('page.resource.received', function(resource) { if (resource.stage !== "end") { return; } if(resource.contentType.indexOf('image')

Ruby - Watir - PhantomJS

浪子不回头ぞ 提交于 2019-12-24 13:52:57
问题 I'm on debian. I have ruby set up with bundle. I do sudo gem install watir-webdriver sudo gem install phantomjs Then I add both to my Gemfile. Then I do bundle install. Then I run ruby code Watir::Browser.new(:phantomjs) and get this error: /var/lib/gems/2.1.0/gems/selenium-webdriver-2.52.0/lib/selenium/webdriver/phantomjs/service.rb:38:in `executable_path': Unable to find phantomjs executable. (Selenium::WebDriver::Error::WebDriverError) How do I make this work? Thanks! 回答1: you don't have

爬虫之selenium使用

扶醉桌前 提交于 2019-12-24 13:00:59
详细使用链接: 点击链接 selenium介绍: selenium最初是一个自动化测试工具,而爬虫中使用它主要是为了解决requests无法直接执行JavaScript代码的问题 selenium本质是通过驱动浏览器,完全模拟浏览器的操作,比如跳转、输入、点击、下拉等,来拿到网页渲染之后的结果,可支持多种常见的浏览器 from selenium import webdriverbrowser=webdriver.Chrome()browser=webdriver.Firefox()browser=webdriver.PhantomJS()browser=webdriver.Safari()browser=webdriver.Edge() 官网: http://selenium-python.readthedocs.io 环境搭建 1.在python中使用selenium需要先安装对应的模块 pip install selenium 2.selenium的原理是操作驱动浏览器来完成对目标页面的请求与渲染,所以需要下载对应的浏览器驱动程序,推荐使用chrome 镜像地址: https://npm.taobao.org/mirrors/chromedriver/ 需要注意的是,驱动程序版本需要与浏览器版本对应,你可以打开chrome的关于浏览器查看到具体版本。 驱动与浏览器的版本对应关系

Some issues capturing web page image with, node-webshot

大憨熊 提交于 2019-12-24 12:54:58
问题 I have a web application, written in node.js with express framework, and Twitter Boostrap 3 in front end, and i'm using this module node-webshot in order to save a state of a page in png format, when a users logout from my site, later show to the user a little thumbnail of, his last state of the page. This module, works really nice, but i'm experimenting some issues, examples: On localhost environment (OSX 10.9): When i put my application on my Digital Ocean VPS (GNU/Linux -> CentOS 6.5). As

Amazon Seller Central Login Scrape PhantomJS + CasperJS

会有一股神秘感。 提交于 2019-12-24 12:44:30
问题 I want to start off by saying that we only scrape our own account, because my company needs data from our own dashboard that we can't get from the MWS APIs. I am very familiar with those APIs. I've had login/scraping scripts for years. But recently Amazon started offering up captchas. My old way of scraping was from PHP making cURL requests to mimic the browser. My new approach is using PhantomJS and CasperJS to achieve the same effect. Everything was working fine for a day, but I'm getting

Using phantom on Node webkit

大兔子大兔子 提交于 2019-12-24 12:37:28
问题 I am trying to scrape dynamic content in Node webkit by using Phantom . I have added phantomjs to env variable also. When i run the application i get a version mismatch error: "Uncaught Error: Module version mismatch. Expected 43, got 46." By running nw:version i get the following versions: nw.js v0.12.3 io.js v1.2.0 Chromium 41.0.2272.76 How should i get around this error? If you were able to implement similar functionality using some other package, let me know. 回答1: Native modules (phantom

How can I extract an input value by id with CasperJS?

血红的双手。 提交于 2019-12-24 12:33:29
问题 I have a casperjs problem. I can't extract value from an id with javascript. I am opening google, searching a term, and i want to get the value from the searchbox by id. var casper = require('casper').create({ verbose: true, logLevel: "info" }); var mouse = require("mouse").create(casper); var x = require('casper').selectXPath; var webPage = require('webpage'); var page = webPage.create(); casper.userAgent('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171

Node js and Phantom js

Deadly 提交于 2019-12-24 12:27:22
问题 I'm looking to scrape a page as an exercise to learn phantomjs however I'm having an issue currently. The image loading is deferred so I'm trying to figure out how I can get phantom js to scroll down and wait for the images to load. SCrolling to the bottom of the page doesnt work so I was thinking of scrolling 100px every 3 seconds until it gets to the bottom of the page. How would I achieve this with? const phantom = require('phantom'); (async function() { const instance = await phantom