casper.js logon amazon
来源:互联网 发布:java hive sql 编辑:程序博客网 时间:2024/05/23 20:58
var LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, casp;casp = require('casper').create({ viewportSize: { width: 1024, height: 768 }, verbose: true, logLevel: 'warning'});var fs = require('fs');casp.userAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');phantom.cookiesEnabled = true;phantom.javascriptEnabled = true;if (!casp.cli.has('username') && !casp.cli.has('password')) { casp.echo('Usage: $ casperjs sfdclogin.casper.js --username=USERNAME --password=PASSWORD [--prod]').exit(-1);}if (casp.cli.has('prod')) { LOGIN_URL = 'https://sellercentral.amazon.com/gp/sign-in/sign-in.html?destination=https%3A%2F%2Fsellercentral.amazon.com%2Fhz%2Fhome';} else { LOGIN_URL = 'https://sellercentral.amazon.com/gp/sign-in/sign-in.html?destination=https%3A%2F%2Fsellercentral.amazon.com%2Fhz%2Fhome';}LOGIN_USERNAME = casp.cli.get('username');LOGIN_PASSWORD = casp.cli.get('password');casp.start(LOGIN_URL, function () { 'use strict';// this.enableCookieSupport();// phantom.cookiesEnabled = true; this.log('Logging in', 'debug'); });casp.then(function () { this.fill('form', { 'username': LOGIN_USERNAME, 'password': LOGIN_PASSWORD }, true); this.log('Logged in', 'debug');});casp.then(function () { 'use strict'; this.echo('We\'re logged in. Now we can do more stuff like take a screenshot!'); this.echo(this.getHTML());});casp.run();
casperjs --ssl-protocol=tlsv1 tt.js --username=dealschic@gmail.com --password=zyz14607terr >> 22.html
下面是从屏幕键盘读取值,代码部分为:
this.echo("What is the ZIP code of the billing address you registered with your credit or debit card number that ends in 13?");zipcode = system.stdin.readLine();
var LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, casp;casp = require('casper').create({ viewportSize: { width: 1024, height: 768 }, verbose: true, logLevel: 'warning'});var fs = require('fs');var system = require('system');casp.userAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');phantom.cookiesEnabled = true;phantom.javascriptEnabled = true;if (!casp.cli.has('username') && !casp.cli.has('password')) { casp.echo('Usage: $ casperjs sfdclogin.casper.js --username=USERNAME --password=PASSWORD [--prod]').exit(-1);}if (casp.cli.has('prod')) { LOGIN_URL = 'https://sellercentral.amazon.com/gp/sign-in/sign-in.html?destination=https%3A%2F%2Fsellercentral.amazon.com%2Fhz%2Fhome';} else { LOGIN_URL = 'https://sellercentral.amazon.com/gp/sign-in/sign-in.html?destination=https%3A%2F%2Fsellercentral.amazon.com%2Fhz%2Fhome';}LOGIN_USERNAME = casp.cli.get('username');LOGIN_PASSWORD = casp.cli.get('password');casp.start(LOGIN_URL, function () { 'use strict';// this.enableCookieSupport();// phantom.cookiesEnabled = true; this.log('Logging in', 'debug'); });casp.then(function () { this.fill('form', { 'username': LOGIN_USERNAME, 'password': LOGIN_PASSWORD }, true); this.log('Logged in', 'debug');});casp.then(function () {this.echo("What is the ZIP code of the billing address you registered with your credit or debit card number that ends in 13?");zipcode = system.stdin.readLine(); this.fill('form', { 'dcq_question_subjective_1': zipcode, }, true); this.log('Logged in', 'debug');});casp.then(function () { 'use strict'; this.echo('We\'re logged in. Now we can do more stuff like take a screenshot!'); this.echo(this.getHTML());});casp.run();
0 0
- casper.js logon amazon
- casper.js
- Logon
- Amazon
- 《casper/鬼马小精灵》
- casperjs 的API-casper模块
- casper#evaluate传参数问题
- Casper.Liu CSDN 重新开博
- 以太坊未来的 POS 协议:Casper
- 理解以太坊 Serenity - 第二部分: Casper
- 对casper源码的一次改动
- Windows LOGON描述(整理)
- Windows LOGON描述
- Windows LOGON描述
- Logon vs Login
- Windows LOGON描述
- about logon page
- nice to logon
- git 使用心得
- Heritrix3.3.0源码阅读 crawler-beans.cxml中处理器链的配置
- leetcode Swap Nodes in Pairs
- 软件版本中的Alpha,Beta,RC,Trial是什么意思?
- iOS --popToViewController -- 跳转界面
- casper.js logon amazon
- IE10不兼容的js写法
- jsp页面传值中文出现乱码的问题
- Mac OS X终端命令 一
- Jacobian矩阵和Hessian矩阵
- Git 取消跟踪已版本控制的文件
- JAVA序列化及反序列化
- ArrayList的使用方法
- Struts2-值栈和OGNL