posts - 12,comments - 1,views - 3590

function simulateMouseDown(target, options) {
var event = new MouseEvent('mousedown', options);
target.dispatchEvent(event);
}

function simulateMouseMove(target, options) {
var event = new MouseEvent('mousemove', options);
target.dispatchEvent(event);
}

function simulateMouseUp(target, options) {
var event = new MouseEvent('mouseup', options);
target.dispatchEvent(event);
}

function checkForSliderVerification() {
// 假设滑动验证码有一个特定的class或id
const slider = document.querySelector('.btn_slide');
if (slider) {
simulateMouseDown(slider, {
view: window,
bubbles: true,
cancelable: true
});

simulateMouseMove(slider, {
view: window,
bubbles: true,
cancelable: true
});

simulateMouseUp(slider, {
view: window,
bubbles: true,
cancelable: true
});

#移动滑块
}
}

// 监听页面加载完成
document.addEventListener('DOMContentLoaded', (event) => {
// 每隔一段时间检查是否出现滑动验证码
setInterval(checkForSliderVerification, 2000);
});

posted on   Vena_12  阅读(61)  评论(0)    收藏  举报
相关博文:
阅读排行:
· .NET 阻止Windows关机以及阻止失败的一些原因
· 博客园2025新款「AI繁忙」系列T恤上架
· Avalonia跨平台实战(二),Avalonia相比WPF的便利合集(一)
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(6)
· C# LINQ 快速入门实战指南,建议收藏学习!
< 2025年4月 >
30 31 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 1 2 3
4 5 6 7 8 9 10

点击右上角即可分享
微信分享提示