learn / Term explained
EN

Browsers and rendering · Terminology explained

JavaScript rendering

JavaScript rendering

Common writing methods: JS rendering, dynamic page, client-side rendering

What it means

The process by which a page runs JavaScript, requests data and updates its content. A scraping task may need to wait for this process before reading the desired data.

Modern pages may continue to fetch data, create nodes, or respond to user interaction after the initial HTML arrives. There are different moments when the HTTP request completes, when DOMContentLoaded occurs, and when the target data is ready.

The wait should be built around an observable target condition, such as a list appearing or a certain response completing, rather than just adding a fixed sleep time. For pages that require clicking, scrolling, or switching tabs, the corresponding interaction steps must also be defined.

In a scraping task

Wait for target content instead of blindly waiting

After opening the page, wait for at least one target node to appear in the product list before reading the fields. This is closer to the task completion conditions than waiting for a fixed number of seconds, but it still needs to handle the situation of no products or loading failure.

Common misconceptions

  • Just because the page triggers the load event does not mean that it will never request data or change the content again.
  • Using the browser does not automatically know which fields are the data you need.

References

Organized by Northleaf Studio. The source link retains the original address to facilitate continued reading.

Back to glossary