Created
September 27, 2021 15:34
-
-
Save DZuz14/988475f94d01b8cc91bf09c6a5425953 to your computer and use it in GitHub Desktop.
Corona 4
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
const worldData = await page.evaluate(() => { | |
const tbody = document.querySelector( | |
"table#main_table_countries_today tbody" | |
); | |
const trs = Array.from( | |
tbody.querySelectorAll("tr:not(.total_row_world)") | |
); | |
const worldData = []; | |
for (const tr of trs) { | |
const tds = Array.from(tr.querySelectorAll("td")); | |
const data = tds.slice(1, 15).map((td) => td.innerText); | |
worldData.push(data); | |
} | |
return worldData; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment