I need to parse a Yahoo Finance RSS news feed and display some information on a webpage but I don't know if I'm parsing correctly and how to display the information. I've tried many things but can't seem to figure it out. Hopefully this is easy for someone and is willing to help me out.
This is the tutorial I've ended up following: How to parse an RSS feed using JavaScript? but they exclude vital parts of coding to make the whole system work. I want to run everything from one .html page.
My current code just shows a blank screen, and in the chrome browser console I get the following message:
"Access to XMLHttpRequest at 'https://feeds.finance.yahoo.com/rss/2.0/headline?s=yhoo®ion=US&lang=en-US' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
FEED_URL = "https://feeds.finance.yahoo.com/rss/2.0/headline?s=yhoo®ion=US&lang=en-US"
$.get(FEED_URL, function (data) {
$(data).find("entry").each(function () {
var el = $(this);
console.log(el.find("title").text());
});
});
</script>
</body>
</html>