Build a web page scraping and testing service using GraphQL and Playwright.
Overview
In my previous article, I walked through with you on developing serverless APIs to test web pages under different resolutions using Puppeteer
. In this article let’s use Playwright
, which is a similar library to perform web browser automation.
Playwright
is a library available in Node.js, Python, and Java to automate Chromium
, Firefox
, and WebKit
with a single API. It is built to enable cross-browser web automation that is ever-green, capable, reliable, and fast.
Setup
Install Playwright
Let’s install Playwright
and browser binaries for Chromium
, Firefox
, and WebKit
. Playwright
requires Python 3.7+.
$ pip install playwright
$ playwright install
Install Python Libraries
Let’s install the required Python libraries. The requirements.txt
is shown below. I am going to…