Javascript 从querySelectorAll输出中移除锚定
要从中获取图书列表,我在firefox DevTools的控制台中使用以下代码:Javascript 从querySelectorAll输出中移除锚定,javascript,Javascript,要从中获取图书列表,我在firefox DevTools的控制台中使用以下代码: var select = document.querySelectorAll("div.post-body.entry-content div h3 b"); for (i = 0; i < select.length; ++i) { var title = select[i].querySelectorAll("u, a")[0]; console.lo
var select = document.querySelectorAll("div.post-body.entry-content div h3 b");
for (i = 0; i < select.length; ++i) {
var title = select[i].querySelectorAll("u, a")[0];
console.log (title.innerHTML);
}
var select=document.querySelectorAll(“div.post-body.entry-content div h3 b”);
对于(i=0;i
输出为:
Introduction to Algorithms by Thomas H. Corman
Algorithms by Robert Sedgewick & Kevin Wayne
The Algorithm Design Manual by Steve S. Skiena
Algorithm for Interviews
5. Algorithm in Nutshell debugger eval code:5:13
6. Algorithm Design by Kleinberg & Tardos debugger eval code:5:13
<a href="https://dev.to/javinpaul/10-best-books-to-learn-data-structure-and-algorithms-in-java-python-c-and-c-5743" target="_blank">7. Introduction to Algorithms: A Creative Approach</a>
7. Introduction to Algorithms: A Creative Approach debugger
8. The Design and Analysis of Algorithms debugger eval code:5:13
9. Data Structures and Algorithms. Aho, Ullman & Hopcroft debugger eval code:5:13
10. Python Algorithms: Mastering Basic Algorithms in the Python Language debugger eval code:5:13
undefined
托马斯·H·科尔曼算法简介
Robert Sedgewick和;凯文韦恩
Steve S.Skiena的算法设计手册
面试算法
5.简而言之,算法调试器评估代码:5:13
6.Kleinberg&;Tardos调试器评估代码:5:13
7.算法简介:一种创造性的调试器方法
8.调试器eval代码5:13算法的设计与分析
9数据结构和算法。Aho、Ullman&;霍普克罗夫特调试器评估代码:5:13
10Python算法:掌握Python语言调试器中的基本算法eval代码:5:13
未定义
如何删除
<a href="https://dev.to/javinpaul/10-best-books-to-learn-data-structure-and-algorithms-in-java-python-c-and-c-5743" target="_blank">7. Introduction to Algorithms: A Creative Approach</a>
从输出
我尝试了console.log(title.firstChild.innerHTML)代码>但它不起作用。以HTML的形式返回节点的内容。
用于除去HTML并仅获取其文本
工作示例:
var select = document.querySelectorAll("div.post-body.entry-content div h3 b");
for (i = 0; i < select.length; ++i) {
var title = select[i].querySelectorAll("u, a")[0];
console.log (title.innerText);
}
var select=document.querySelectorAll(“div.post-body.entry-content div h3 b”);
对于(i=0;i