17 lines
447 B
JavaScript
17 lines
447 B
JavaScript
|
// EDIT THIS FILE TO COMPLETE ASSIGNMENT QUESTION 1
|
||
|
const { chromium } = require("playwright");
|
||
|
|
||
|
async function sortHackerNewsArticles() {
|
||
|
// launch browser
|
||
|
const browser = await chromium.launch({ headless: false });
|
||
|
const context = await browser.newContext();
|
||
|
const page = await context.newPage();
|
||
|
|
||
|
// go to Hacker News
|
||
|
await page.goto("https://news.ycombinator.com/newest");
|
||
|
}
|
||
|
|
||
|
(async () => {
|
||
|
await sortHackerNewsArticles();
|
||
|
})();
|