关于javascript:百度一刻相册批量下载的方法

7次阅读

共计 702 个字符,预计需要花费 2 分钟才能阅读完成。

不想用一刻相册了,我感觉百度是个坑,说不定哪天让你付费,否则就无奈下载图片
然而下载的时候发现,每次只能选中 100 张,我就在控制台写了一个遍历模仿点击的代码

async function   download(){document.querySelectorAll(".time img").forEach(dom=>{console.log(dom.click())// 遍历选中默认 100 张
})
await delay(2000) // 延时 1 秒
document.querySelector(".yk-icon-datuxiazai").click()// 触发下载
await delay(2000)// 提早疫苗
document.querySelectorAll(".time img").forEach(dom=>{console.log(dom.click())// 把下载的删除,我的目标是为了清空一刻相册,转到别的网盘,你不要清空这句能够删掉
})
await delay(2000)
document.querySelector(".right-btn .yk-icon-trash").click()
await delay(2000)
document.querySelector(".popover-content .confirm").click()// 触发删除,也能够删掉
await delay(1000)

setTimeout(this.download,7000)
}
// 提早函数
function delay(time){return new Promise((r,e)=>{setTimeout(r,time)
    })
}
download()
正文完
 0