querySelector a <content:encoder> from RSS

I’m trying to read images from an RSS feed. Title and description work because they are visible, but when I want to fetch the image it doesn’t work because it’s placed in <content:encoder> tag. So how to fetch the images ?

I’m using this code to print data for example for title




const RSS_URL = `https://cors-anywhere.herokuapp.com/https://fitgirl-repacks.site/feed/`;  fetch(RSS_URL)   .then(response => response.text())   .then(str => new window.DOMParser().parseFromString(str, "text/xml"))   .then(data => {     console.log(data);     const items = data.querySelectorAll("item");     let html = ``;     items.forEach(el => {       html += `         <article>           <img src="${el.querySelector("link").innerHTML}/image/large.png" alt="">           <h2>             <a  href="${el.querySelector("link").innerHTML}" target="_blank" rel="noopener">               ${el.querySelector("title").innerHTML}               </a>         </article>       `;     });     document.body.insertAdjacentHTML("beforeend", html);   }); 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.