2022-10-27 22:38:31
116阅读
const http = require('http');
http.createServer(function (req, res) {
const { chromium, firefox, webkit } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('http://www.good1230.com');
await page.screenshot({ path: `screenshot.png` });
await browser.close();
})();
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('Node.js says hello!');
res.end();
}).listen(8080);
文章来源:https://playwright.dev/docs/api/class-playwright
最后生成于
2024-06-22 12:07:27
热门推荐:
此内容有帮助 ?
0