posts in
Measuring page performance

The need for fast and responsive applications has never been greater because of the move from desktop to mobile. Still, web applications have been increasing in complexity and size, with rising load times. It is therefore clear why the topic of webpage performance is more popular today than it likely ever was.

This article aims at giving a practical introduction to the whys and hows of web performance, without getting lost in the depth or breadth of this massive topic.

Scraping pages

We call the action of extracting data from web pages web scraping. Scraping is useful for a variety of use cases:

  1. In testing and monitoring, asserting against the state of one or more elements on a page
  2. In general, gathering data for a variety of different purposes

What is Playwright?

The official documentation for Playwright reads:

Playwright provides a set of APIs to automate Chromium, Firefox and WebKit browsers. By using the Playwright API, you can write JavaScript code to create new browser pages, navigate to URLs and then interact with elements on a page.

The resemblance to Google's Puppeteer is striking, and for good reason.

Taking screenshots

Headless browsers are fully capable of taking screenshots, which is very useful in troubleshooting failures or faulty scripts. Using additional libraries and tools, it is also possible to automate vis...

Working with selectors

The way you reference a UI element of your target web application for Puppeteer and Playwright to interact with is through CSS selectors. Becoming proficient in the usage of such selectors is therefore a requirement for writing quality scripts.