Code Monkey home page Code Monkey logo

alipay-crawler's Introduction

alipay-crawler

功能说明

  • 无限循环抓取首页记录
  • 指定时间段抓取所有记录
  • 查询指定订单号
  • 支持多个支付宝账号

安装

git clone git@github.com:he426100/alipay-crawler.git

使用方法

seleniumhq.org 下载 selenium-server

启动服务

java -jar selenium-server-standalone-#.jar

补充:需要把chromedriver.exe和selenium-server-standalone-#.jar放在同一个目录下

启动爬虫

  • 无限循环爬取账务明细首页交易记录(可用于实现个人收款)
php cli.php alipay fetchHome name="全部" tab="" acceptNames=""
  • 抓取指定任意时间段记录
php cli.php alipay fetchAll name="全部" start="2018-04-01 00:00:00" end="2018-04-26 23:59:59" tab="" acceptNames=""
  • 查询支付宝订单号
php cli.php alipay query tradeNo=2018xxx
  • 其他参数

指定支付宝账号密码

alipay_account=xxx alipay_password=xxx

指定爬虫服务端口(多个爬虫同时运行,selenium-server-standalone-#.jar可以使用-port指定端口号)

port=4444

说明

  • 本项目未经过严格测试,请谨慎用于生产环境
  • selenium-ide和katalon都可以录制,katalon录制出来后无法设置支付宝账务明细页面的时间段,我是先分别用两个插件录制,然后再用selenium-ide的部分步骤替换katalon,再用katalon导出php代码

数据库

CREATE TABLE `xx_alipay_order` (
    `id`  int(11) NOT NULL AUTO_INCREMENT ,
    `alipay_account`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '支付宝账号' ,
    `order_time`  int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '时间' ,
    `memo`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `trade_no`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `other`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '对方' ,
    `amount`  decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '金额' ,
    `detail`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '明细' ,
    `status`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '状态' ,
    `used`  tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 未使用 1已使用' ,
    `balance`  decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '账户余额' ,
    `outer_order_sn`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '商家订单号' ,
    `created_at`  datetime NOT NULL ,
    `updated_at`  datetime NOT NULL ,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `trade_no_name` (`trade_no`, `name`) USING BTREE 
)
ENGINE=InnoDB

参考

alipay-crawler's People

Contributors

he426100 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

alipay-crawler's Issues

报错

at D:\code\php\alipay-crawler\vendor\symfony\options-resolver\OptionsResolver.php: 651
647: * lazy options and/or normalizers
648: * @throws NoSuchOptionException If a lazy option reads an unavailable option
649: * @throws AccessException If called from a lazy option or normalizer
650: */
651: public function resolve(array $options = array())
652: {
653: if ($this->locked) {
654: throw new AccessException('Options cannot be resolved from a lazy option or normalizer.');
655: }
656:

Exception trace:

1 Symfony\Component\OptionsResolver\OptionsResolver::resolve()
D:\code\php\alipay-crawler\lib\Extend\Alipay.php : 40

2 Lib\Extend\Alipay::__construct()
D:\code\php\alipay-crawler\app\Console\Alipay.php : 37

Please use the argument -v to see more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.