问卷星在线批量刷,自动答题,自动刷新(清除)Cookies,需手动点击滑块验证和提交,支持单选、多选、下拉框、量表、矩阵量表、填空。代码采用ES6+,低版本浏览器可能无法使用。不需要更改链接中的 vm 为 vj。
< Feedback on 问卷星在线刷
替换这个滑块函数, 可以解决滑块错误的问题// 滑动滑块来验证 function slidingSlider() { const slider = document.querySelector("#nc_1_n1z"); const retryBtn = document.querySelector(".nc-lang-cnt a"); if (!slider) return; const startX = slider.getBoundingClientRect().left + window.pageXOffset; const startY = slider.getBoundingClientRect().top + window.pageYOffset; const endX = startX + 260; const endY = startY; const options = {bubbles: true, cancelable: true}; // 模拟不规则滑动轨迹 const moveSlider = (startX, startY, endX, endY) => { let currentX = startX; const step = (endX - startX) / 20; // 分20步完成滑动 let i = 0; const interval = setInterval(() => { currentX += step + Math.random() * 2; // 增加一些随机性 slider.dispatchEvent(new MouseEvent('mousemove', Object.assign(options, { clientX: currentX, clientY: startY + Math.random() * 5 // 模拟一点y轴的抖动 }))); i++; if (i >= 20) { clearInterval(interval); slider.dispatchEvent(new MouseEvent('mouseup', options)); // 完成滑动 } }, 50 + Math.random() * 50); // 每步延迟 50-100ms,模拟自然滑动 }; slider.dispatchEvent(new MouseEvent('mousedown', options)); moveSlider(startX, startY, endX, endY); // 检测滑动验证失败的情况,点击重试按钮 setTimeout(() => { if (retryBtn && retryBtn.style.display !== "none") { retryBtn.click(); setTimeout(slidingSlider, 1000); // 等待1秒后重新滑动 } }, 3000); // 等待3秒,检测是否需要重试 }
Sign in to post a reply.
替换这个滑块函数, 可以解决滑块错误的问题
// 滑动滑块来验证
function slidingSlider() {
const slider = document.querySelector("#nc_1_n1z");
const retryBtn = document.querySelector(".nc-lang-cnt a");
if (!slider) return;
const startX = slider.getBoundingClientRect().left + window.pageXOffset;
const startY = slider.getBoundingClientRect().top + window.pageYOffset;
const endX = startX + 260;
const endY = startY;
const options = {bubbles: true, cancelable: true};
// 模拟不规则滑动轨迹
const moveSlider = (startX, startY, endX, endY) => {
let currentX = startX;
const step = (endX - startX) / 20; // 分20步完成滑动
let i = 0;
const interval = setInterval(() => {
currentX += step + Math.random() * 2; // 增加一些随机性
slider.dispatchEvent(new MouseEvent('mousemove', Object.assign(options, {
clientX: currentX,
clientY: startY + Math.random() * 5 // 模拟一点y轴的抖动
})));
i++;
if (i >= 20) {
clearInterval(interval);
slider.dispatchEvent(new MouseEvent('mouseup', options)); // 完成滑动
}
}, 50 + Math.random() * 50); // 每步延迟 50-100ms,模拟自然滑动
};
slider.dispatchEvent(new MouseEvent('mousedown', options));
moveSlider(startX, startY, endX, endY);
// 检测滑动验证失败的情况,点击重试按钮
setTimeout(() => {
if (retryBtn && retryBtn.style.display !== "none") {
retryBtn.click();
setTimeout(slidingSlider, 1000); // 等待1秒后重新滑动
}
}, 3000); // 等待3秒,检测是否需要重试
}