-
-
Save valentinvieriu/67b7552129754d4e2eec4539c76a4426 to your computer and use it in GitHub Desktop.
gets a random domain name from https://www.domainsfortherestofus.com/ via cors-anywhere
This file contains hidden or 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
(async function () { | |
const response = await fetch('https://cors-anywhere.herokuapp.com/https://www.domainsfortherestofus.com/'); | |
const text = await response.text(); | |
const parser = new DOMParser(); | |
const document = parser.parseFromString(text, 'text/html'); | |
const domain = document.querySelector("body > div.content > div > div > div.left-side > div.domain > a").text; | |
console.log('domain', domain); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment