|
@@ -1547,63 +1547,70 @@
|
|
let m1 = await page.$('img[class^=PicGallery--thumbnailPic--]');
|
|
let m1 = await page.$('img[class^=PicGallery--thumbnailPic--]');
|
|
let m2 = await page.$('img[class*=thumbnailPic--]');
|
|
let m2 = await page.$('img[class*=thumbnailPic--]');
|
|
if(!m1 && !m2){ // 出现弹窗而且没有主图,判断为拦截模式
|
|
if(!m1 && !m2){ // 出现弹窗而且没有主图,判断为拦截模式
|
|
- /** 手动滑动过滤拦截验证拦截 **/
|
|
|
|
- const iframe = await iframeElementHandle.contentFrame();
|
|
|
|
- const handle = await iframe.$('.btn_slide'); //滑块
|
|
|
|
- const handle2 = await iframe.$('.nc_scale'); //轨道
|
|
|
|
- if(handle && handle2){
|
|
|
|
- const box = await handle.boundingBox();
|
|
|
|
- const boxEnd = await handle2.boundingBox();
|
|
|
|
- const center = {
|
|
|
|
- x: box.x + box.width / 2,
|
|
|
|
- y: box.y + box.height / 2
|
|
|
|
- };
|
|
|
|
- const centerEnd = {
|
|
|
|
- x: center.x + boxEnd.width,
|
|
|
|
- y: box.y + box.height / 2
|
|
|
|
- };
|
|
|
|
- await page.mouse.move(center.x, center.y);
|
|
|
|
- await page.mouse.down();
|
|
|
|
- await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 80 });
|
|
|
|
- await page.mouse.up();
|
|
|
|
- await page.waitForTimeout(500);
|
|
|
|
|
|
+ await tbBrowser.close();
|
|
|
|
+ urlInfo.status = '6';
|
|
|
|
+ resolve(true);
|
|
|
|
+ this.loading = false;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // if(!m1 && !m2){ // 出现弹窗而且没有主图,判断为拦截模式
|
|
|
|
+ // /** 手动滑动过滤拦截验证拦截 **/
|
|
|
|
+ // const iframe = await iframeElementHandle.contentFrame();
|
|
|
|
+ // const handle = await iframe.$('.btn_slide'); //滑块
|
|
|
|
+ // const handle2 = await iframe.$('.nc_scale'); //轨道
|
|
|
|
+ // if(handle && handle2){
|
|
|
|
+ // const box = await handle.boundingBox();
|
|
|
|
+ // const boxEnd = await handle2.boundingBox();
|
|
|
|
+ // const center = {
|
|
|
|
+ // x: box.x + box.width / 2,
|
|
|
|
+ // y: box.y + box.height / 2
|
|
|
|
+ // };
|
|
|
|
+ // const centerEnd = {
|
|
|
|
+ // x: center.x + boxEnd.width,
|
|
|
|
+ // y: box.y + box.height / 2
|
|
|
|
+ // };
|
|
|
|
+ // await page.mouse.move(center.x, center.y);
|
|
|
|
+ // await page.mouse.down();
|
|
|
|
+ // await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 80 });
|
|
|
|
+ // await page.mouse.up();
|
|
|
|
+ // await page.waitForTimeout(500);
|
|
|
|
|
|
- const nocaptcha = await iframe.$('#nocaptcha');
|
|
|
|
- if(nocaptcha){ // 第一次滑动未通过再次点击验证
|
|
|
|
- await nocaptcha.click();
|
|
|
|
- await page.waitForTimeout(500);
|
|
|
|
|
|
+ // const nocaptcha = await iframe.$('#nocaptcha');
|
|
|
|
+ // if(nocaptcha){ // 第一次滑动未通过再次点击验证
|
|
|
|
+ // await nocaptcha.click();
|
|
|
|
+ // await page.waitForTimeout(500);
|
|
|
|
|
|
- const reHandle = await iframe.$('.btn_slide'); //滑块
|
|
|
|
- const reHandle2 = await iframe.$('.nc_scale'); //轨道
|
|
|
|
- if(reHandle && reHandle2){
|
|
|
|
- const box = await reHandle.boundingBox();
|
|
|
|
- const boxEnd = await reHandle2.boundingBox();
|
|
|
|
- const center = {
|
|
|
|
- x: box.x + box.width / 2,
|
|
|
|
- y: box.y + box.height / 2
|
|
|
|
- };
|
|
|
|
- const centerEnd = {
|
|
|
|
- x: center.x + boxEnd.width,
|
|
|
|
- y: box.y + box.height / 2
|
|
|
|
- };
|
|
|
|
- await page.mouse.move(center.x, center.y);
|
|
|
|
- await page.mouse.down();
|
|
|
|
- await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 80 });
|
|
|
|
- await page.mouse.up();
|
|
|
|
- await page.waitForTimeout(500);
|
|
|
|
|
|
+ // const reHandle = await iframe.$('.btn_slide'); //滑块
|
|
|
|
+ // const reHandle2 = await iframe.$('.nc_scale'); //轨道
|
|
|
|
+ // if(reHandle && reHandle2){
|
|
|
|
+ // const box = await reHandle.boundingBox();
|
|
|
|
+ // const boxEnd = await reHandle2.boundingBox();
|
|
|
|
+ // const center = {
|
|
|
|
+ // x: box.x + box.width / 2,
|
|
|
|
+ // y: box.y + box.height / 2
|
|
|
|
+ // };
|
|
|
|
+ // const centerEnd = {
|
|
|
|
+ // x: center.x + boxEnd.width,
|
|
|
|
+ // y: box.y + box.height / 2
|
|
|
|
+ // };
|
|
|
|
+ // await page.mouse.move(center.x, center.y);
|
|
|
|
+ // await page.mouse.down();
|
|
|
|
+ // await page.mouse.move(centerEnd.x, centerEnd.y, { steps: 80 });
|
|
|
|
+ // await page.mouse.up();
|
|
|
|
+ // await page.waitForTimeout(500);
|
|
|
|
|
|
- let iframeElementHandle2 = await page.$('iframe');
|
|
|
|
- if(iframeElementHandle2){
|
|
|
|
- await tbBrowser.close();
|
|
|
|
- urlInfo.status = '6';
|
|
|
|
- resolve(true);
|
|
|
|
- this.loading = false;
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // let iframeElementHandle2 = await page.$('iframe');
|
|
|
|
+ // if(iframeElementHandle2){
|
|
|
|
+ // await tbBrowser.close();
|
|
|
|
+ // urlInfo.status = '6';
|
|
|
|
+ // resolve(true);
|
|
|
|
+ // this.loading = false;
|
|
|
|
+ // return false;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
let pageInfo = await page.evaluate(() => {
|
|
let pageInfo = await page.evaluate(() => {
|