Web Page Scraping and Testing using GraphQL and Playwright

alpha2phi
2 min readApr 4, 2021

Build a web page scraping and testing service using GraphQL and Playwright.

Photo by Frank Albrecht on Unsplash

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…

--

--

alpha2phi
alpha2phi

Written by alpha2phi

Software engineer, Data Science and ML practitioner.

No responses yet