-
Notifications
You must be signed in to change notification settings - Fork 0
/
AliSliderCracker.js
46 lines (35 loc) · 1.37 KB
/
AliSliderCracker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const puppeteer = require('puppeteer')
async function bypass(url){
const browser = await puppeteer.launch({
headless: false, //
defaultViewport: {width:1366, height:768}
})
const page = await browser.newPage()
await page.evaluateOnNewDocument(() => {
Object.defineProperty(navigator, 'webdriver',{
get: () => false
})
})
//Login page
await page.goto(url)
//Input email and password
await page.click('input#fm-login-id.fm-text')
await page.keyboard.type('Lz429671594@outlook.com');
await page.click('input#fm-login-password.fm-text');
await page.keyboard.type('pf52CE4JyGiY7fj');
await page.click('.fm-button')
// let sliderElement = await page.$('span.btn_slide')
await page.waitForSelector('.nc_iconfont.btn_slide', {timeout: 30000})
const sliderElement = await page.$('.slidetounlock')
const slider = await sliderElement.boundingBox()
const sliderHandle = await page.$('.nc_iconfont.btn_slide')
const handle = await sliderHandle.boundingBox()
await page.mouse.move(handle.x + handle.width / 2, handle.y + handle.height / 2)
await page.mouse.down()
await page.mouse.move(handle.x + slider.width, handle.y + handle.height / 2, {steps:50})
await page.mouse.up()
await page.waitForNavigation({
waitUntil: 'load'
});
await browser.close()
}