Skip to content

Commit

Permalink
feat: 增加好豆provider
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Nov 26, 2017
1 parent b778ec0 commit 0939b50
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/providers/好豆.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const Provider = require('../provider');
const utils = require('../utils');

module.exports = class extends Provider {
constructor() {
super();
this.url = `http://login.haodou.com/register.php`;
}
async resolve(ctx) {
const options = ctx.options;
const page = ctx.page;

await utils.mockUserMouse(page);

await page.type('#mobile_account', options.phone, { delay: 100 });

// 按下鼠标,拖动滚动条
await page.mouse.move(280, 315);
await page.mouse.down();
await page.mouse.move(560, 318, { steps: 20 });
await page.mouse.up();
// 松开鼠标

await page.click('#btn_send_sms1');

// 检验是否发送成功
// 没法检测
}
};

0 comments on commit 0939b50

Please sign in to comment.