当前位置:网站首页>一键过滤选择百度网盘文件
一键过滤选择百度网盘文件
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>
边栏推荐
- KMP匹配字符串
- Easy change
- BUU-Crypto-Cipher
- Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
- Trie number dictionary tree
- Google Chrome browser will support the function of selecting text translation
- [matlab] matlab simulation - simulate the AM modulation process of the modulation system
- [matlab] matlab simulation modulation system - DSB system
- With the advent of the IP era, how can E-sports hotels take advantage of the "east wind" of games?
- [matlab] matlab simulation modulation system FM system
猜你喜欢

Introduction to AMBA
![BUU-Crypto-[HDCTF2019]basic rsa](/img/d0/8e451dabb2a6897f6680220d16d04d.jpg)
BUU-Crypto-[HDCTF2019]basic rsa
![[paper summary] zero shot semantic segmentation](/img/78/ee64118d86a7e43ec4d1cb97191fbe.jpg)
[paper summary] zero shot semantic segmentation

Programmers don't talk about morality, and use multithreading for Heisi's girlfriend

The data mark is a piece of fat meat, and it is not only China Manfu technology that focuses on this meat

Etcd database source code analysis - initialization overview

Programming example of stm32f1 and stm32subeide -74hc595 drives 4-bit 7-segment nixie tube

ETCD数据库源码分析——初始化总览

Integer type of C language
![BUU-Real-[PHP]XXE](/img/97/b7139270145e6aa6a4f5d1067e2527.jpg)
BUU-Real-[PHP]XXE
随机推荐
How to configure static IP for Kali virtual machine
SQL injection - injection based on MSSQL (SQL Server)
十二. golang其他
Penetration tool - sqlmap
光模塊字母含義及參數簡稱大全
JS string splicing enhancement
fastjson
Unity2d -- character moves and turns
BUU-Crypto-[GXYCTF2019]CheckIn
LC weekly 300
Leetcode 184 Employees with the highest wages in the Department (July 3, 2022)
KMP匹配字符串
Evolution of system architecture: differences and connections between SOA and microservice architecture
Void convolution, deformable convolution, deformable ROI pooling
[matlab] matlab simulation modulation system - VSB system
Solar insect killing system based on single chip microcomputer
ETCD数据库源码分析——初始化总览
What are the reasons for the frequent high CPU of ECS?
【QT】制作MyComboBox点击事件
Etcd database source code analysis - initialization overview