puppeteer 2.2.0 puppeteer: ^2.2.0 copied to clipboard
A high-level API to control headless Chrome over the DevTools Protocol. This is a port of Puppeteer in Dart.
import 'package:puppeteer/puppeteer.dart';
void main() async {
// Download the Chromium binaries, launch it and connect to the "DevTools"
var browser = await puppeteer.launch();
// Open a new tab
var myPage = await browser.newPage();
// Go to a page and wait to be fully loaded
await myPage.goto('https://dart.dev', wait: Until.networkIdle);
// Do something... See other examples
await myPage.screenshot();
await myPage.pdf();
await myPage.evaluate('() => document.title');
// Gracefully close the browser's process
await browser.close();
}