forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45b9136
commit 1521e19
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Retos/Reto #18 - WEB SCRAPING [Difícil]/javascript/BRivasTorres.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import puppeteer from "puppeteer"; | ||
|
||
const webScraping = async() => { | ||
const browser = await puppeteer.launch({ | ||
headless: false, | ||
slowMo: 400 | ||
}); | ||
const page = await browser.newPage(); | ||
await page.goto("https://holamundo.day"); | ||
const result = await page.evaluate(() => { | ||
const blockquotes = document.querySelectorAll("blockquote"); | ||
const data = [...blockquotes].slice(21,).map(blockquote => { | ||
const time = blockquote.innerText | ||
return time | ||
|
||
}) | ||
return data | ||
}) | ||
console.log(result.join('\n')) | ||
await browser.close() | ||
} | ||
|
||
webScraping() |