Skip to content

Commit

Permalink
feat: 增加中关村在线provider
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Oct 27, 2017
1 parent 5779b71 commit b6f2bc7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/providers/中关村在线.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Provider = require('../provider');
const utils = require('../utils');

module.exports = class extends Provider {
constructor() {
super();
this.url = `http://service.zol.com.cn/user/siteLogin.php`;
}
async resolve(ctx) {
const options = ctx.options;
const page = ctx.page;

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

await utils.sleep(500);

await page.click('#get-anicode');

// 检验是否发送成功
await page.waitForSelector('.resendphonecode', { timeout: 1000 * 3 });
}
};

0 comments on commit b6f2bc7

Please sign in to comment.