当前位置:网站首页>一键过滤选择百度网盘文件
一键过滤选择百度网盘文件
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>
边栏推荐
- [matlab] general function of communication signal modulation bandpass filter
- JS string splicing
- 2022年A特种设备相关管理(电梯)考试题模拟考试平台操作
- ping端口神器psping
- tutle时钟改进版
- 简易零钱通
- Ping port artifact psping
- Introduction To AMBA 简单理解
- Programming example of stm32f1 and stm32subeide -74hc595 drives 4-bit 7-segment nixie tube
- VB. Net calls ffmpeg to simply process video (class Library-6)
猜你喜欢

RSA加密应用常见缺陷的原理与实践

Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..

2022年R2移动式压力容器充装复训题库及答案

Flutter calls Gaode map app to realize location search, route planning and reverse geocoding

Simulated small root pile

Zhongke panyun-2022 Guangdong Trojan horse information acquisition and analysis

2022g2 power station boiler stoker special operation certificate examination question bank and answers
![[interested reading] advantageous filtering modeling on long term user behavior sequences for click through rate pre](/img/3e/b5df691ca1790469eb1b4e8ea5b4c0.png)
[interested reading] advantageous filtering modeling on long term user behavior sequences for click through rate pre

Trie数-字典树

ping端口神器psping
随机推荐
[matlab] matlab simulation - low pass Gaussian white noise
(4) Canal multi instance use
2022 a special equipment related management (elevator) examination questions simulation examination platform operation
[matlab] matlab simulation - simulate the AM modulation process of the modulation system
Yyds dry goods inventory TCP & UDP
The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat
Simulink and Arduino serial port communication
小程序毕业设计---美食、菜谱小程序
2022年T电梯修理操作证考试题库及模拟考试
拓扑排序和关键路径的图形化显示
[matlab] matlab simulation of modulation system - power spectrum and coherent demodulation of AM modulated signal
[interested reading] advantageous filtering modeling on long term user behavior sequences for click through rate pre
Zhongke Panyun - data analysis and forensics packet flag
What is MQ?
Flink1.13 basic SQL syntax (II) join operation
[matlab] communication signal modulation general function interpolation function
Etcd database source code analysis - initialization overview
如何使用postman实现简单的接口关联【增删改查】
2022年R2移动式压力容器充装复训题库及答案
LC周赛300