如何使用 JQuery 获取带有标签名称'<ht:picture_source>'元素?



我试图用这个RSS源链接抓取谷歌趋势

然而,我无法获得标签名称为<ht:picture_source>..</ht:picture_source>的元素。

我尝试了下面的代码:

$(".trigger").on("click",function() {
$.ajax({
url: "https://trends.google.co.in/trends/trendingsearches/daily/rss?geo=US",
dataType: 'text',
success: function(data) {
let post_count = $(data).find('title').length;
for(let counter = 1; counter < post_count; counter++) {
let image = $(data).find('ht:picture').eq(counter).text();
console.log(image);
}


}
});
});

我在控制台上得到未定义或空。

2年前就有人在GigHub上查过了。

感谢您的帮助。

像:这样的特殊字符在jQuery选择器中需要转义

let image = $('body').find('ht\:picture_source').eq(0).text();
console.log(image);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ht:picture_source>Text</ht:picture_source>

最新更新