I tried to get html element of a webpage using jquery and an URL.
Hi, I am new in web development. I am learnig day by day. Today I tried to get the content of a webpage using jquery and an URL. But not able to get content. I get help from AI, but it's not working.
Here's my URL https://tailwindbt.blogspot.com/2023/05/perfect-fried-rice-plate-is-really.html, from where I want to get the value of <span class="eta" id="etawrap"></span>
spans. I tried this way, but not getting.
My Approach:
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<div class="my-div"></div>
<script>
const url = "https://tailwindbt.blogspot.com/2023/05/perfect-fried-rice-plate-is-really.html";
$.get(url, function(data) {
const parsedHtml = $.parseHTML(data);
const span = $(parsedHtml).find("#etawrap");
const textContent = span.text();
$(".my-div").html(textContent);
});
</script>
But its not working. What I can do ?