Skip to content
Advertisement

how can i extract a specific element from the html

I am trying to extract an element from the html with the function that I have.

JavaScript

I have an input where I put the url of a page and the function brings me the complete html of the page

JavaScript

this is the html that it throws me, now what I want is to extract that div element with the offer class

Advertisement

Answer

You can use parseFromString to get the string from the response into a format you can query the DOM.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement