From 27a49ffb67fd508896ec46719c13f20ea1671623 Mon Sep 17 00:00:00 2001 From: axetroy Date: Sun, 3 Dec 2017 22:38:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=BA=A6=E4=BB=98=E5=AE=9Dprovider?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=AD=A3=E7=A1=AE=E6=A3=80=E6=B5=8B=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\351\272\246\344\273\230\345\256\235.js" | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git "a/app/providers/\351\272\246\344\273\230\345\256\235.js" "b/app/providers/\351\272\246\344\273\230\345\256\235.js" index 2385aa2..41e76a2 100644 --- "a/app/providers/\351\272\246\344\273\230\345\256\235.js" +++ "b/app/providers/\351\272\246\344\273\230\345\256\235.js" @@ -7,16 +7,23 @@ module.exports = class extends Provider { constructor() { super(); this.url = `https://www.maifupay.com/register`; + this.alone = true; } async resolve(ctx) { const options = ctx.options; const page = ctx.page; - await page.type('input.form-control', options.phone, { delay: 100 }); + await page.type('input[name="mobile"]', options.phone, { delay: 50 }); - await page.click('span.input-group-btn button:first-child'); + await page.click('#sendVerifySmsButton'); -// await page.waitForSelector('span.input-group-btn button:first-child[disabled]', { timeout: 1000 * 3 }); + await utils.sleep(1000); + + try { + await page.waitForSelector('#sendVerifySmsButton[disabled]'); + } catch (err) { + throw null; + } } };