Playwright is a Node.js library developed by Microsoft that allows you to control web browsers to automate web interactions. You can use it for tasks like scraping websites, automating UI tests, taking screenshots, etc.
Here are the system requirements for installing Playwright:
Operating System: Playwright can run on Windows, Mac, and Linux.
Node.js: Since Playwright is a Node.js library, you need to have Node.js installed on your system to use it. Playwright requires Node.js v12.0.0 or above.
npm or Yarn: npm (Node Package Manager) is distributed with Node.js - which means that when you download Node.js, you automatically get npm installed on your computer. Alternatively, you can also use Yarn, which is another popular package manager for Node.js.
System Dependencies: Playwright requires certain system dependencies. These are automatically installed by the Playwright post-install script on Windows and MacOS. For Linux, you might have to install them manually. The exact commands depend on your Linux distribution. For Ubuntu 18.04, you can use:
sudo apt-get install libgtk-3-0 libnss3 libasound2 libgbm-dev
- Browsers: Playwright works with Chromium, Firefox and WebKit. The Playwright npm package will automatically download the supported versions of all these browsers the first time you install the package.
Once you have ensured all these system requirements, you can install Playwright using npm or Yarn:
Using npm:
npm i playwright
Using Yarn:
yarn add playwright
After the installation, Playwright scripts are ready to be run.