commit
This commit is contained in:
14
Bomtoon_JS/canvas_count.js
Normal file
14
Bomtoon_JS/canvas_count.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const divs = document.querySelectorAll('div[class^="CanvasViewer__Container"]');
|
||||
console.log("符合条件的 div 总数:", divs.length);
|
||||
|
||||
const div = document.querySelector('div.printView > div:not(style)');
|
||||
const div2 = Array.from(div.children).filter(el => el.tagName.toLowerCase() === 'div')[1];
|
||||
const div2_1_1_1 = div2.querySelector('div:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1)');
|
||||
const count = Array.from(div2_1_1_1.children).filter(el => {
|
||||
return el.tagName.toLowerCase() === 'div' &&
|
||||
el.hasAttribute('width') &&
|
||||
el.hasAttribute('height');
|
||||
}).length;
|
||||
|
||||
console.log("div2.1.1.1 下的 <div> 数量为:", count);
|
||||
console.log(document.title);
|
||||
Reference in New Issue
Block a user