     [Answers](https://scrapfly.io/blog)   /  [playwright](https://scrapfly.io/blog/tag/playwright)   /  [How to wait for page to load in Playwright?](https://scrapfly.io/blog/answers/how-to-wait-for-page-to-load-in-playwright)   # How to wait for page to load in Playwright?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Aug 27, 2026 3 min read [\#playwright](https://scrapfly.io/blog/tag/playwright) [\#python](https://scrapfly.io/blog/tag/python) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright "Share on LinkedIn") [  ](https://x.com/intent/tweet?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright&text=How%20to%20wait%20for%20page%20to%20load%20in%20Playwright%3F "Share on X") [  ](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright "Share on Facebook")    

 

 

Summarize this article with

 [  ](https://chat.openai.com/?q=Summarize%20this%20article%20and%20explain%20how%20Scrapfly%20helps%20me%20scrape%20any%20website%20at%20scale%20and%20bypass%20anti-bot%20systems%20for%20my%20use%20case%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [  ](https://claude.ai/new?q=Summarize%20this%20article%20and%20explain%20how%20Scrapfly%20helps%20me%20scrape%20any%20website%20at%20scale%20and%20bypass%20anti-bot%20systems%20for%20my%20use%20case%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [  ](https://x.com/i/grok?text=Summarize%20this%20article%20and%20explain%20how%20Scrapfly%20helps%20me%20scrape%20any%20website%20at%20scale%20and%20bypass%20anti-bot%20systems%20for%20my%20use%20case%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [  ](https://www.perplexity.ai/search/new?q=Summarize%20this%20article%20and%20explain%20how%20Scrapfly%20helps%20me%20scrape%20any%20website%20at%20scale%20and%20bypass%20anti-bot%20systems%20for%20my%20use%20case%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [  ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20article%20and%20explain%20how%20Scrapfly%20helps%20me%20scrape%20any%20website%20at%20scale%20and%20bypass%20anti-bot%20systems%20for%20my%20use%20case%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) 



When scraping dynamic web pages with Playwright and Python we need to wait for the page to fully load before we retrieve the page source for HTML parsing. Let's explore multiple load event methods to ensure a full web page load!



## Selectors

In order to make Playwright wait for page to load, we can use Playwright's [wait\_for\_selector](https://playwright.dev/python/docs/api/class-page#page-wait-for-selector) method. It ensures a full page load state waiting for specific elements to appear on the web page:

```
with sync_playwright() as pw:
    browser = pw.chromium.launch(headless=False)
    context = browser.new_context(viewport={"width": 1920, "height": 1080})
    page = context.new_page()

    # go to url
    page.goto("https://web-scraping.dev/products")
    # wait for element to appear on the page:
    page.wait_for_selector("div.products")
    # get HTML
    print(page.content())
```



Above, we start by creating a new browser context, navigate to the target web page, and wait for the CSS selector `div.products` to be visible. Finally, we return the page object once it's fully loaded.



## Fixed Timeouts

The seconds waiting process is the [wait\_for\_timeout](https://playwright.dev/python/docs/api/class-page#page-wait-for-timeout) method. Unlike the previous method, this approach doesn't utilize locating elements on the document. Instead, it instructs the browser to wait for a fixed time:

python```python
    page.goto("https://web-scraping.dev/products")
    page.wait_for_timeout(5000)
```



Here, we use the `wait_for_timeout` to explicitly wait for 5 seconds before executing the remaining script actions.



Scrapfly

#### Need a cloud browser for scraping?

Run headless browsers at scale with Scrapfly Cloud Browser — no infrastructure to manage.

[Try Free →](https://scrapfly.io/register)## Rendering State

The latest load event we'll use is the [wait\_for\_load\_state](https://playwright.dev/python/docs/api/class-page#page-wait-for-load-state), it relies on different states of network connections:

- **domcontentloaded**: Waits for the initial DOM structure to be present without waiting for static files to finish loading.
- **networkidle**: Waits until there are no network connections for at least 500 milliseconds. The Playwright documentation marks this state as discouraged, because a page with polling or streaming may never go idle and the wait then runs to its timeout. Prefer waiting for a selector.
- **load**: Waits the HTML document and its static files to be fully loaded.

Here's how to use the wait\_for\_load\_state to let Playwright wait for page to load through different states:

python```python
    page.goto("https://web-scraping.dev/products")
    page.wait_for_load_state("domcontentloaded")
    page.wait_for_load_state("networkidle")
    page.wait_for_load_state("load")
```



## Timeout Errors

When a wait is never satisfied, Playwright raises a timeout instead of hanging:

```
playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.
```



The default is 30 seconds, and the message is identical whichever call ran out of time. Identify the source before changing the number:

- **Navigation timeout** from `page.goto()`. The document never reached the requested load state. A `networkidle` wait on a page that never goes idle is the common cause.
- **Action timeout** from a call like `page.click()` or `page.fill()`. The element exists but never became actionable, for example because an overlay sits on top of it.
- **Locator timeout** from `page.wait_for_selector()`. The selector never matched anything, which is a selector problem rather than a speed problem.

Raising the timeout only helps the first case. For the other two, fix the selector or the interaction.



For further details on web scraping with Playwright, refer to our dedicated guide.

[Web Scraping With Playwright in 2026: A Python GuideScrape JavaScript-rendered pages with Playwright and Python in 2026: locators, waiting, request interception, resource blocking, and concurrency.](https://scrapfly.io/blog/posts/web-scraping-with-playwright-and-python)



 

   [  Add as a preferred source ](https://google.com/preferences/source?q=scrapfly.io) Table of Contents















 

  Table of Contents- [Selectors](#selectors)
- [Fixed Timeouts](#fixed-timeouts)
- [Rendering State](#rendering-state)
- [Timeout Errors](#timeout-errors)
 
    Join the Newsletter  Get monthly web scraping insights 

 

  



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

 ## Related Articles

 [  

 python crawling 

### How to Find All URLs on a Domain

Learn how to efficiently find all URLs on a domain using Python and web crawling. Guide on how to crawl entire domain to...

 

 ](https://scrapfly.io/blog/posts/how-to-find-all-urls-on-a-domain) [     

 python screenshots 

### How to Track Web Page Changes with Automated Screenshots

There are many different ways to monitor web page changes and one of the most popular techniques is screenshot tracking....

 

 ](https://scrapfly.io/blog/posts/how-to-track-web-page-changes-using-automated-screenshots) [     

 python headless-browser 

### How to Scrape Infinite Scroll, Load More &amp; Paginated Pages

Learn to scrape infinite scroll, load more, and paginated pages in 2026 by reverse-engineering the request first and usi...

 

 ](https://scrapfly.io/blog/posts/how-to-scrape-infinite-scroll-load-more-and-paginated-pages) 

  ## Related Questions

- [ Q How to wait for a page to load in Puppeteer? ](https://scrapfly.io/blog/answers/how-to-wait-for-page-to-load-in-puppeteer)
- [ Q How to use XPath selectors in Python? ](https://scrapfly.io/blog/answers/how-to-use-xpath-selectors-in-python)
- [ Q How to get page source in Puppeteer? ](https://scrapfly.io/blog/answers/how-to-get-page-source-in-puppeteer)
- [ Q What are some ways to parse JSON datasets in Python? ](https://scrapfly.io/blog/answers/what-are-some-ways-to-parse-json-datasets-in-python)
 
  



   



 Run headless browsers at scale, **1,000 free credits** [Start Free](https://scrapfly.io/register)