From ccf0aee31a1979e5d4ec744c026431d63cf4cecd Mon Sep 17 00:00:00 2001 From: WindomZ Date: Sat, 2 Dec 2017 22:29:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20=E5=BE=AE=E7=9B=9F=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50\344\272\272\347\275\221\347\273\234.js" | 8 +++--- "app/providers/\345\276\256\347\233\237.js" | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 "app/providers/\345\276\256\347\233\237.js" diff --git "a/app/providers/\345\267\250\344\272\272\347\275\221\347\273\234.js" "b/app/providers/\345\267\250\344\272\272\347\275\221\347\273\234.js" index 8885898..85b3c8c 100644 --- "a/app/providers/\345\267\250\344\272\272\347\275\221\347\273\234.js" +++ "b/app/providers/\345\267\250\344\272\272\347\275\221\347\273\234.js" @@ -17,9 +17,9 @@ module.exports = class extends Provider { await page.click('#reg_form input.get-mpcode'); -// // 检验是否发送成功 -// await page.waitForSelector('#reg_form input.get-mpcode[disabled]', { -// timeout: 1000 * 3, -// }); + // // 检验是否发送成功 + // await page.waitForSelector('#reg_form input.get-mpcode[disabled]', { + // timeout: 1000 * 3, + // }); } }; diff --git "a/app/providers/\345\276\256\347\233\237.js" "b/app/providers/\345\276\256\347\233\237.js" new file mode 100644 index 0000000..633ae32 --- /dev/null +++ "b/app/providers/\345\276\256\347\233\237.js" @@ -0,0 +1,25 @@ +'use strict'; + +const Provider = require('../provider'); +const utils = require('../utils'); + +module.exports = class extends Provider { + constructor() { + super(); + this.url = `https://account.weimob.com/register`; + } + + async resolve(ctx) { + const options = ctx.options; + const page = ctx.page; + + await page.type('input#phone', options.phone, { delay: 100 }); + + await page.click('a.getcode'); + + // // 检验是否发送成功 + // await page.waitForSelector('a.getcode.disabled', { + // timeout: 1000 * 3, + // }); + } +};