     [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) Apr 18, 2026 2 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")    

 

 

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 for all background network operations to be finished loading and is idle for at least 500 milliseconds.
- **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")
    PageMethod("wait_for_load_state", "domcontentloaded"),
    PageMethod("wait_for_load_state", "networkidle"),
    PageMethod("wait_for_load_state", "load"),
```





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

[Web Scraping with Playwright and PythonPlaywright is the new, big browser automation toolkit - can it be used for web scraping? In this introduction article, we'll take a look how can we use Playwright and Python to scrape dynamic websites.](https://scrapfly.io/blog/posts/web-scraping-with-playwright-and-python)



 

    Table of Contents- [Selectors](#selectors)
- [Fixed Timeouts](#fixed-timeouts)
- [Rendering State](#rendering-state)
 
    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. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-wait-for-page-to-load-in-playwright) 



 ## 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 ecommerce 

### How to Scrape BestBuy Product, Offer and Review Data

Learn how to scrape BestBuy, one of the most popular retail stores for electronic stores in the United States. We'll scr...

 

 ](https://scrapfly.io/blog/posts/how-to-scrape-bestbuy-product-offer-and-review-data) 

  ## 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 How to wait for page to load in Selenium? ](https://scrapfly.io/blog/answers/how-to-wait-for-page-to-load-in-selenium)
 
  



   



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