Skip to content

Instantly share code, notes, and snippets.

@DZuz14
Created September 27, 2021 15:34
Show Gist options
  • Save DZuz14/988475f94d01b8cc91bf09c6a5425953 to your computer and use it in GitHub Desktop.
Save DZuz14/988475f94d01b8cc91bf09c6a5425953 to your computer and use it in GitHub Desktop.
Corona 4
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