-
-
Save Comandeer/2d2e442b0c89b6173cc085d5e6948f52 to your computer and use it in GitHub Desktop.
Using DOMParser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return fetch( URL ).then( ( response ) => { | |
return response.text(); | |
} ).then( ( html ) => { | |
const parser = new DOMParser(); // 1 | |
return parser.parseFromString( html, 'text/html' ); // 2 | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment