Skip to content

Conversation

simonabadoiu
Copy link
Contributor

Summary

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Copy link
Contributor

github-actions bot commented Sep 25, 2025

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/browser-rendering/ @mchenco, @cloudflare/pcx-technical-writing, @celso, @danielgek, @kathayl, @ToriLindsay
* @cloudflare/pcx-technical-writing

Copy link
Contributor

github-actions bot commented Sep 25, 2025

Preview URL: https://2942e1f5.preview.developers.cloudflare.com
Preview Branch URL: https://brapi-docs-single-page-application.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/browser-rendering/rest-api/json-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/json-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/links-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/links-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/markdown-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/markdown-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/pdf-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/pdf-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/scrape-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/scrape-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/screenshot-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/screenshot-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/content-endpoint/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/content-endpoint/
https://developers.cloudflare.com/browser-rendering/rest-api/snapshot/ https://brapi-docs-single-page-application.preview.developers.cloudflare.com/browser-rendering/rest-api/snapshot/

@@ -0,0 +1,11 @@
### Single Page Applications (SPAs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Single Page Applications (SPAs)
## Scrape a Single Page Applications (SPAs)

@@ -0,0 +1,11 @@
### Single Page Applications (SPAs)

When scraping a Single Page Application (SPA) with dynamic content, you must ensure the page has fully loaded. To do this, you have two main options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When scraping a Single Page Application (SPA) with dynamic content, you must ensure the page has fully loaded. To do this, you have two main options:
To scrape a Single Page Application (SPA) with dynamic content, make sure the page has fully loaded using one of these methods:

### Single Page Applications (SPAs)

When scraping a Single Page Application (SPA) with dynamic content, you must ensure the page has fully loaded. To do this, you have two main options:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Recommended: Use `waitForSelector` to wait for a specific element to appear on the page.
- Use `goToOptions` with `networkidle0` or `networkidle2`. Between the `networkidle` options, `networkidle2` is more efficient because it waits until there are less than two ongoing network connections, whereas `networkidle0` waits until all network connections are idle and all resources (including asynchronous JavaScript) have loaded.


When scraping a Single Page Application (SPA) with dynamic content, you must ensure the page has fully loaded. To do this, you have two main options:

:::note
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:::note

When scraping a Single Page Application (SPA) with dynamic content, you must ensure the page has fully loaded. To do this, you have two main options:

:::note
Use `waitForSelector` to wait for a specific element to appear on the page. This is often the most reliable and efficient method.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use `waitForSelector` to wait for a specific element to appear on the page. This is often the most reliable and efficient method.


:::note
Use `waitForSelector` to wait for a specific element to appear on the page. This is often the most reliable and efficient method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

:::note
Use `waitForSelector` to wait for a specific element to appear on the page. This is often the most reliable and efficient method.

Use `goToOptions` with `"networkidle0"` or `"networkidle2"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use `goToOptions` with `"networkidle0"` or `"networkidle2"`

Use `waitForSelector` to wait for a specific element to appear on the page. This is often the most reliable and efficient method.

Use `goToOptions` with `"networkidle0"` or `"networkidle2"`
- `"networkidle0"` waits for all network connections to be idle, meaning all resources (including asynchronous JavaScript) have been loaded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `"networkidle0"` waits for all network connections to be idle, meaning all resources (including asynchronous JavaScript) have been loaded


Use `goToOptions` with `"networkidle0"` or `"networkidle2"`
- `"networkidle0"` waits for all network connections to be idle, meaning all resources (including asynchronous JavaScript) have been loaded
- `"networkidle2"` is a more efficient alternative that waits until there are only two or fewer ongoing network connections
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `"networkidle2"` is a more efficient alternative that waits until there are only two or fewer ongoing network connections

Use `goToOptions` with `"networkidle0"` or `"networkidle2"`
- `"networkidle0"` waits for all network connections to be idle, meaning all resources (including asynchronous JavaScript) have been loaded
- `"networkidle2"` is a more efficient alternative that waits until there are only two or fewer ongoing network connections
:::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:::

@ToriLindsay
Copy link
Contributor

@simonabadoiu Sorry for the delay. This didn't auto-assign to me when you submitted it for some reason so I just saw it. Left you some suggestions. Let me know when you're done and I'll approve. Thanks!
cc: @kathayl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants