Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/472.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 需要使用JS检索元素数组的帮助吗_Javascript_Jquery_Html - Fatal编程技术网

Javascript 需要使用JS检索元素数组的帮助吗

Javascript 需要使用JS检索元素数组的帮助吗,javascript,jquery,html,Javascript,Jquery,Html,有人能帮我从一个网站上检索几个元素吗。 这是网站: 它显示了所有带有标记Android N功能的文章 我想得到所有文章的标题。标题包含在class.post标题的标记中,标题位于header.post-header->h2->a.text中 我知道我需要从getElementsByTagName(“header”)开始,但我不知道如何继续。感谢您的帮助 感谢@EvaMariam解决了这个问题 jQuery('header.post header').find('h2').children('a'

有人能帮我从一个网站上检索几个元素吗。 这是网站:

它显示了所有带有标记Android N功能的文章 我想得到所有文章的标题。标题包含在class.post标题的标记中,标题位于header.post-header->h2->a.text中

我知道我需要从getElementsByTagName(“header”)开始,但我不知道如何继续。感谢您的帮助

感谢@EvaMariam解决了这个问题
jQuery('header.post header').find('h2').children('a').text()

我不了解javascript..我是jquery新手。。使用

jQuery('header.post header').find('h2').children('a').text()


您可以在jquery中使用find()和children()来获取带有类post header的header标记中的h2标记,并过滤带有子标记的h2。

这是一个第三方网站。嗨,我对javascript一无所知。我是jquery新手。。使用jQuery('header.post header').find('h2').children('a').text()。。这就是你要找的吗?要求我们推荐或查找书籍、工具、软件库、教程或其他非现场资源的问题对于堆栈溢出来说都是离题的,因为它们往往会吸引自以为是的答案和垃圾邮件。相反,请描述问题以及迄今为止为解决问题所做的工作。谢谢@EvaMariam的帮助!成功了,谢谢你,伊娃!