感谢大佬!加了个视频标题
var linkElements = document.querySelectorAll('a#video-title[href]'); var count = linkElements.length;
console.log('Total number of links:', count);
linkElements.forEach(function(element, index) { console.log('Link ' + (index + 1) + ': ' + element.title, element.href); });
|