当前位置:网站首页>一键过滤选择百度网盘文件
一键过滤选择百度网盘文件
2022-07-04 05:21:00 【a10615】
背景
今天拍照馆通过百度网盘给我发了266张照片,让我选择20张入册。但对方把.CR2和.JPG两种格式都发过来了,其实我只需要把.JPG的下载下来,然后去选择。但我需要从中选择133张,这种数量多、重复性的工作,挺考验耐力的。作为程序员,肯定要想个懒办法去解决它,毫无疑问,就从前端(Ctrl+Shift+I,浏览器的开发者工具)来解决
找到两种文件的不同点
对应的元素布局:
<dd class="g-clearfix AuPKyz open-enable" _position="132" _cmd_installed="1" _installed="1">
<span node-type="EOGexf" class="EOGexf"></span>
<div class="JS-fileicon fileicon-small-pic"></div>
<div class="file-name" style="width:60%">
<div class="text">
<a href="javascript:void(0);" class="filename" title="_P5A1453.JPG">_P5A1453.JPG</a>
</div>
...
</div>
</dd>
<dd class="g-clearfix AuPKyz" _position="133" _cmd_installed="1" _installed="1">
<span node-type="EOGexf" class="EOGexf"></span>
<div class="JS-fileicon default-small"></div>
<div class="file-name" style="width:60%">
<div class="text">
<a href="javascript:void(0);" class="filename" title="_P5A1397.CR2">_P5A1397.CR2</a>
</div>
...
</div>
</dd>
不同点就在<dd>
标签内的class中。所以只要这么一捞,133个文件就全部捞出来了:
document.getElementsByClassName('g-clearfix AuPKyz open-enable')
执行点击事件
剩下的,就是给执行点击操作:
document.getElementsByClassName('g-clearfix AuPKyz open-enable').forEach(item => item.firstElementChild.click())
注意:
item.click()
,是单选功能,而多选,必须使用其子元素<span>
边栏推荐
- 力扣(LeetCode)184. 部门工资最高的员工(2022.07.03)
- 如何使用postman实现简单的接口关联【增删改查】
- Character types of C language
- What is MQ?
- 2022 t elevator repair operation certificate examination question bank and simulation examination
- Simulink与Arduino串口通信
- [matlab] matlab simulation of modulation system - power spectrum and coherent demodulation of AM modulated signal
- Zhongke Panyun - module a infrastructure setting and safety reinforcement scoring standard
- KMP match string
- left_and_right_net可解释性设计
猜你喜欢
Integer type of C language
2022年R2移动式压力容器充装复训题库及答案
[paper summary] zero shot semantic segmentation
Zhongke Panyun - module a infrastructure setting and safety reinforcement scoring standard
LM small programmable controller software (based on CoDeSys) note 22: error 4268/4052
2022g2 power station boiler stoker special operation certificate examination question bank and answers
National vocational college skills competition (secondary vocational group) network security competition questions - Analysis
PostgreSQL has officially surpassed mysql. Is this guy too strong!
BUU-Crypto-Cipher
transformer坑了多少算力
随机推荐
LM小型可编程控制器软件(基于CoDeSys)笔记二十一:错误3703
National vocational college skills competition (secondary vocational group) network security competition questions - Analysis
[QT] create mycombobox click event
LM小型可编程控制器软件(基于CoDeSys)笔记二十二:错误4268/4052
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
flink1.13 sql基础语法(二)join操作
Automated testing selenium foundation -- webdriverapi
19.Frambuffer应用编程
[matlab] matlab simulation modulation system - VSB system
简易零钱通
Unity2d -- character moves and turns
724. 寻找数组的中心下标
[high concurrency, high performance and high availability of massive data MySQL practice-7] - memory data drop disk
PostgreSQL has officially surpassed mysql. Is this guy too strong!
KMP match string
flink1.13 sql基础语法(一)DDL、DML
[matlab] communication signal modulation general function - low pass filter
Just do it with your hands 7 - * project construction details 2 - hook configuration
Halcon图片标定,使得后续图片处理过后变成与模板图片一样
Simulink and Arduino serial port communication