Created
December 20, 2022 19:44
-
-
Save Krymancer/d9bb259cfd98f4f5dc251abcc0827b4d to your computer and use it in GitHub Desktop.
signos
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
import { JSDOM } from "jsdom"; | |
const url = 'https://gadget.horoscopovirtual.com.br/horoscopo'; | |
async function getDocument() { | |
const response = await fetch(url); | |
const html = await response.text(); | |
return html; | |
} | |
const html = await getDocument(); | |
const dom = new JSDOM(html); | |
const result = Array.from(dom.window.document.querySelectorAll(".on > p")).map((x) => x.textContent); | |
const signs = result.map(x => x.split('\n')[1]); | |
console.log(signs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment